zapsterstudios / crud-generator
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
pkg:composer/zapsterstudios/crud-generator
This package is not auto-updated.
Last update: 2025-09-28 08:38:25 UTC
README
Laravel-API-CRUD-Generator
This package generates all the needed files and snippets for a CRUD (Create, Read, Update and Delete) API endpoint. This includes: Model, Migration, Controller, Routes and Policy (Used for restricting route access). This package also takes care of validation with the $rules variable in the model.
Usage
php artisan make:crud SomeModelName
Installation
Install with Composer
Run the following command.
composer require zapsterstudios/crud-generator
Register ServiceProvider
Add the following class to the providers
array in config/app.php
.
ZapsterStudios\CrudGenerator\PackageServiceProvider::class,
Handle Policy AuthorizationException
Add the following statement in the render
function in app/Exceptions/Handler.php
.
if($exception instanceof \Illuminate\Auth\Access\AuthorizationException) { if($request->expectsJson()) { return response()->json(['error' => 'Forbidden.'], 403); } }