2017 © Pedro Peláez
 

library crud-generator

image

zapsterstudios/crud-generator

  • Monday, June 12, 2017
  • by ZapsterStudios
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Total Downloads Latest Stable Version License StyleCI, (*1)

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., (*2)

Usage

php artisan make:crud SomeModelName, (*3)

Installation

Install with Composer

Run the following command., (*4)

composer require zapsterstudios/crud-generator

Register ServiceProvider

Add the following class to the providers array in config/app.php., (*5)

ZapsterStudios\CrudGenerator\PackageServiceProvider::class,

Handle Policy AuthorizationException

Add the following statement in the render function in app/Exceptions/Handler.php., (*6)

if($exception instanceof \Illuminate\Auth\Access\AuthorizationException) {
    if($request->expectsJson()) {
        return response()->json(['error' => 'Forbidden.'], 403);
    }
}

The Versions

12/06 2017

dev-master

9999999-dev

  Sources   Download

MIT

by Avatar ZapsterStudios

02/06 2017

1.0.0

1.0.0.0

  Sources   Download

MIT

by Avatar ZapsterStudios