envoo / laravel-api-tools
Tools for laravel api applications
v1.1.2
2023-05-24 08:45 UTC
Requires
- php: ^8.1
- timacdonald/json-api: ^1.0@beta
- wendelladriel/laravel-validated-dto: ^2.2
README
Provide useful tools for Laravel API development
Installation
composer require envoo/laravel-api-tools
Configuration
php artisan vendor:publish --provider="Envoo\LaravelApiTools\LaravelApiToolsServiceProvider" --tag=config
Artisan commands
php artisan envoo:make:filter
php artisan envoo:make:resource
php artisan envoo:make:enum
Traits for models
use Filterable;
-> add filter
scope to model. Use filter command to generate filter class.
use HasSlug
-> add slug
attribute to model. Generating slug from model name property.
use HasUsername
-> add username
attribute to model. Generating username from model name property.
use InteractWithPagination
-> add paginateUnderCondition
and paginateAnyway
scopes to model.
If your model extending Envoo\LaravelApiTools\Models\Model
you can use pagination and filter scopes by default.