Closed polsust closed 1 year ago
I managed to install doctrine/dbal
but it didn't fix my problem
Are you using something like SQLite and these columns are not available yet? What happens when you run:
php artisan model:show Key
I am running mySQL
This is the output
App\Models\Key ...................................................................................................................................
Database ................................................................................................................................... mysql
Table ....................................................................................................................................... keys
Attributes ........................................................................................................................... type / cast
Relations ........................................................................................................................................
keyable MorphTo ................................................................................................................... App\Models\Key
keyStatus BelongsTo ......................................................................................................... App\Models\KeyStatus
keyType BelongsTo ............................................................................................................. App\Models\KeyType
Observers ........................................................................................................................................
this package depends on the Laravel artisan model:show command, so if there is nothing generated from that command in that Attributes
section, we cannot generate the type.
That is expected because the model doesn't have any Attributes
but it does have columns in the database
Thats not what is meant int the Attributes section of that output, its not referring to Model Attributes (like castors and mutators). It will show both models columns and accessor, for example:
What this packages does it takes whatever is in the Attributes section and turns into TS type. If nothing is there it would be expected nothing is generated from the model:typer command
What happened?
After running :
I noticed that none of the fillables of my models where outputed into the interfaces.
Laravel version:
9.51.0
php version:8.1.19
I tried running:
and it returned:
Expected Behavior
I expected to recieve the generated interfaces with my model's fillables.
example of model:
example of autogenerated interface:
Steps To Reproduce