PHP code example of onecentlin / laravel-adminer

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

    

onecentlin / laravel-adminer example snippets


'providers' => [
    ...
    Onecentlin\Adminer\ServiceProvider::class,
];



return [
    'enabled' => env('ADMINER_ENABLED', true),
    'autologin' => env('ADMINER_AUTO_LOGIN', false),
    'route_prefix' => env('ADMINER_ROUTE_PREFIX', 'adminer'),
    'middleware' => 'auth',
    'plugins' => [],
];

return Application::configure(basePath: dirname(__DIR__))
    ->withProviders()
    ->withRouting()
    ->withMiddleware(function (Middleware $middleware) {

        // [SETUP HERE] Adminer Middleware group
        $middleware->group('adminer', [
            \Illuminate\Cookie\Middleware\EncryptCookies::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\Auth\Middleware\Authenticate::class,
        ]);

    })
    ->withExceptions(function (Exceptions $exceptions) {
        //
    })->create();

protected $middlewareGroups = [
    ...
    'adminer' => [
        \App\Http\Middleware\EncryptCookies::class,
        \Illuminate\Session\Middleware\StartSession::class,
        // TODO: you may create customized middleware to fit your needs
        // example uses Laravel default authentication (default protection)
        \Illuminate\Auth\Middleware\Authenticate::class,
    ],
];

return [
    ...
    'plugins' => [
        'PluginClassNameWithoutArguments',
        'PluginClassNameWithArgument' => 'argument_value',
        'PluginClassNameWithMultipleArguments' => ['arg1', 'arg2', ...],
    ],
];

php artisan vendor:publish --provider="Onecentlin\Adminer\ServiceProvider"