Laravel REST API Develop(Generate)
1 min readJul 19, 2022
I recently launched a new package that gives you a powerful setup for REST API in comfortable Laravel syntax using Laravel`s own standard.
What Cover in this package?
below is the functionality covered in this package
- API route
- API resource ( Controller )
- Form Request
- API Resource
- API Collection
- API Response using Macro
- API Exception Handler
Github
Installation
you can install the package via composer:
composer require dipeshsukhia/laravel-api-develop
Usage
install default configuration
php artisan develop-api:install
use trait in App\Exceptions\Handler.php
use App\Exceptions\Traits\ApiHandlerTrait;
class Handler extends ExceptionHandler
{
use ApiHandlerTrait;php artisan develop-api --model=User
How to use it?
You have to create the laravel database model and its migration and need to run php artisan develop-api — model=ModelName for generating or developing apis.
it will generate an API route, form request, API controller, API resource, and API collection based on Laravel standards.