PHP code example of an5dy / laravel-admin-modules

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

    

an5dy / laravel-admin-modules example snippets


...
use App\{模块名}\Middleware\ModuleBootstrap;

class {模块名}ServiceProvider extends ServiceProvider
{
    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        app('router')->aliasMiddleware('admin.bootstrap', ModuleBootstrap::class);
    }
    ...
}

app/{模块名}
├── Controllers
├── Models
├── Providers
│   └── {模块名}ServiceProvider.php
└── routes.php
shell
php artisan admin:module:controller {module} {model} {--title=} {--stub= : Path to the custom stub file. } {--output}
shell
php artisan admin:module:bootstrap {module}

app/{模块名}
├── Controllers
├── Middleware
│   └── ModuleBootstrap.php
├── Models
├── Providers
│   └── {模块名}ServiceProvider.php
├── bootstrap.php
└── routes.php