PHP code example of onepkg / laravel-crud-generator

1. Go to this page and download the library: Download onepkg/laravel-crud-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

onepkg / laravel-crud-generator example snippets


[
    'namespacedModel' => 'App\\Models',
    'namespacedRequest' => 'App\\Http\\Requests\\Admin',
    'namespacedResource' => 'App\\Http\\Resources\\Admin',
    'namespacedController' => 'App\\Http\\Controllers\\Admin',
]
plaintext
app/
├── Http/
│   ├── Controllers/
│   │   └── Api/
│   │       └── {Model}Controller.php  # RESTful controller
│   ├── Requests/
│   │       └── {Model}Request.php    # Form request
│   ├── Resources/
|   |       └── {Model}Collection.php   # JSON collection  
│   │       └── {Model}Resource.php   # JSON resource
├── Models/
│   └── {Model}.php                 # Model
└── Routes/
    └── api.php                     # API route
bash
php artisan onepkg:make-crud User
bash
php artisan onepkg:make-crud User --table=user
bash
php artisan onepkg:make-crud User --route=api
bash
php artisan vendor:publish --provider="Onepkg\LaravelCrudGenerator\LaravelCrudServiceProvider"
bash
php artisan stub:publish