Páginas · Laravilt
Models
Generate Eloquent models, migrations and factories inside a plugin.
bash
The model is created in src/Models/ under the plugin namespace. Add fillable fields, casts and relations as you would in any Laravel app:
php
migration Post creates database/migrations/{timestamp}_create_posts_table.php. factory PostFactory creates database/factories/PostFactory.php in the {Namespace}\Database\Factories namespace, linked to {Namespace}\Models\Post.
Make sure the plugin's service provider loads its migrations (the generator adds this when you select the migrations feature):
php