PHP code example of arrahmouni / crud-generator

1. Go to this page and download the library: Download arrahmouni/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/ */

    

arrahmouni / crud-generator example snippets


return [
    'stub_path' => resource_path('stubs/'), // Custom stub path
    // Add other configuration parameters
];
bash
php artisan vendor:publish --provider="CrudGeneratorServiceProvider" --tag=config
php artisan vendor:publish --provider="CrudGeneratorServiceProvider" --tag=stubs
bash
php artisan create:crud ModelName ModuleName
bash
php artisan create:crud Product Catalog

ModuleName/
├── Entities/
│   └── ModelName.php
├── Http/
│   ├── Controllers/Admin/
│   │   └── ModelNameController.php
│   ├── Controllers/Api/
│   │   ├── Admin/          (optional, when admin API crud)
│   │   │   └── ModelNameController.php
│   │   └── Front/          (optional, front API controller)
│   │       └── ModelNameController.php
│   ├── Services/
│   └── Requests/
├── Resources/
│   ├── ModelNameResource.php
│   └── views/...           (optional)
├── Database/
│   ├── migrations/
│   ├── factories/
│   └── seeders/
└── Routes/
    ├── web.php             (admin web routes)
    └── api.php             (admin API and/or front API routes)
bash
php artisan module:seed Permission
bash
php artisan module:migrate ModuleName