🧠Resource

Our framework has a generator to generate complete resources with very easy commands you just build your schema and the command will create a complete CRUD operation and APIs for you.

Create Migration

first, make a migration like

php artisan make:migration create_customer_table

after you fill migration with your schema run migration

php artisan migrate

Generate Command

now it's time for building the resource just run this command with the table name

php artisan vilt:resource

it will ask you to input the table name and the module you like to put the resource on it, and this command will generate a model from the table and create a resource for you

Files

the generator will generate 6 files for you

1- Model File will be generated inside your module folder Entities

2- Resource File will be generated inside your Vilt/Resources Folder

3- Resource Folder will be generated inside your Vilt/Resources Folder

4- Traits Folder will be generated inside your Vilt/Resources/ResourceName Folder

5- 2 Traits will be generated inside your Traits folder Translations and Components

Last updated