Require this package with composer using the following command:
composer require g4t/laravel-design-pattern
php artisan vendor:publish --provider=g4t\Pattern\PatternServiceProvider
php artisan repo:name User
php artisan repo:name User --model=User
php artisan repo:validation ModelName
Command | Description |
---|---|
--m |
Create Migration |
--model={ModelName} |
Insert model in controller if you have model |
--force |
override existing Repository |
You can modify parameters in config/jsonapi.json
/users?filter[name]=John
INCLUDING RELATIONS BASED ON A REQUEST
/users?include=posts
/users?include=posts,comments
SORTING A QUERY BASED ON A REQUEST
/users?sort=id
/users?sort=-id
TAKE DATA
/users?take=10
SKIP DATA
/users?skip=10
Laravel Design Pattern Generator is free software licensed under the MIT license.