7nohe / laravel-typegen

The library lets you generate TypeScript types from your Laravel code
79 stars 5 forks source link

Support Non-Default Namespace for Model Type Export #29

Closed NaoyaMiyagawa closed 5 months ago

NaoyaMiyagawa commented 5 months ago

Issues

Changes

This PR changes the way to specify a model name in php artisan model:show command. This change is inspired from this comment below:

Meaning, conventionally model:show command was used like this:

php artisan model:show User ...
php artisan model:show Common/History ...

And moving forward, model:show command will be used like this:

php artisan model:show App\\Models\\User ...
php artisan model:show App\\Models\\Common\\History ...

// if modular monolith
php artisan model:show Modules\\Post\\Comment ...

Output

Result of debug.sh

(no change)

Sample result of output in modular monolith structure:

NaoyaMiyagawa commented 5 months ago

Hi @7nohe, I made an attempt to resolve the issue I raised. Let me know if you have any issues or concerns about this change!