This extension can query your database tables and insert the relevant eloquent model attributes such as $fillable, $casts, etc.
Features
Use the Command Palette to excute "Insert Eloquent Model Attributes" in your model file. The extension will automatically get your database information and asks you to input the table name.
You can use the "Insert PHPDoc for Eloquent Model Attributes" command to insert PHPDoc for the model.
This extension can detect and insert following attribute changes. You can change these in the extension settings.
Primary Key
Different primary key name other than id.
Checks if the auto increment is turned off.
Checks if the primary is a UUID and adds HasUuids trait.
Soft Deletes
If the table is using soft deletes, SoftDeletes trait will be added.
Fillables
The primary key will be ignored.
The foreign keys will be ignored.
Auto incrementing columns will be ignored.
Any columns with the text password, token, or admin in the name will be ignored.
Any columns ending in _at will be ignored.
Any columns starting with is_ will be ignored.
Everything else is addeed to the $fillable array.
Attribute Casting
created_at, updated_at and deleted_at are not casted.