Skip to content
adminer for laravel
Branch: master
Clone or download
hanqiang
Latest commit cb85155 Jun 2, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Update UpdateCommand.php Mar 23, 2018
.gitignore
README.md fix readme Jun 2, 2018
composer.json add guzzle require Jun 2, 2018

README.md

adminer-for-laravel 5.*

Adminer is a full-featured database management tool written in PHP. This package automates setup for adminer and routes your.domain.here/adminer to the the adminer.php script.

Installation

Composer

composer require leung/laravel-adminer

OR

Add directly to your composer.json

"require": {
    "leung/laravel-adminer": "^2.0"
},

Providers

Laravel <5.4

open your config/app.php and add this line in providers section

Simple\Adminer\AdminerServiceProvider::class
OR prevent it being on production

open your app/Providers/AppServiceProvider.php and add this line in the register() function

if ($this->app->environment() !== 'production') {
    $this->app->register(\Simple\Adminer\AdminerServiceProvider::class);
}

Laravel 5.5 providers

auto included via automatic package discovery

   // no need to add anything!!!

Update adminer.php

Linux command line update

php artisan adminer:update

You can configure your composer.json to do this after each commit:

"scripts": {
    "post-install-cmd": [
        "php artisan adminer:update"
    ],
    "post-update-cmd": [
        "php artisan adminer:update"
    ]
}

[Optional] Middleware

Middleware is added in via the service provider

to override this you may add a adminer route to your App routes.php

    Route::any('adminer', '\Simple\Adminer\Controllers\AdminerController@index')->middleware('adminer_custom_middleware'); // where you defined your middleware in app/Http/Kernel.php

Add middleware group example

to add a custom middleware group you will need to add it to middlewareGroups in your app/Http/Kernel.php

protected $middlewareGroups = [
    ...
    'adminer_custom_middleware' => [
        \App\Http\Middleware\EncryptCookies::class,
        \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
        \Illuminate\Session\Middleware\StartSession::class,

        // you may create customized middleware to fit your needs
        ...
    ],
];

Modify app/Http/Middleware/VerifyCsrfToken.php

also add adminer to $except array if you are using the example optional adminer group

protected $except = [
     'adminer'
 ];
You can’t perform that action at this time.