infinito/laravel-crud-api-generator

1.0 2023-01-23 16:06 UTC

This package is auto-updated.

Last update: 2023-01-23 16:08:35 UTC


README

For new project.

1.- Install package:

For prod:
composer require infinito/laravel-crud-api-generator

For dev:
composer require infinito/laravel-crud-api-generator:dev-main


For remove:
composer remove infinito/laravel-crud-api-generator

2.-Excute

php artisan make:controller Dev/TestController

3.- Add Dev/TestController add web.php:

...

use Infinito\LaravelCrudApiGenerator\Scripts;

...


class TestController {

    public function __invoke(){
    
        (new Scripts())->__invoke();
        echo "Ready!";
        
    }
    
}

4.- Add web.php:

Route::get('/test', [\App\Http\Controllers\Dev\TestController::class, '__invoke'])->name('test');

5.- Add inside "app/Http\Middleware\VerifyCsrfToken" exception "VerifyCsrfToken.php"

...
 protected $except = [
    'generator/*', // <---- This Line
    ...
 ];
...

6.- Add first time Postman or request get by URl

http://127.0.0.1:8090/test

7.- Then see form

http://127.0.0.1:8090/generator

Folder structure

- Controller

- Models

- Repositories

Nota: Para nueva version, creae una "tag" y volver a subir la version