2017 © Pedro Peláez
 

library laravel-adminer

Adminer (by Jakub Vrana) wrapper for Laravel 5

image

miroc/laravel-adminer

Adminer (by Jakub Vrana) wrapper for Laravel 5

  • Wednesday, May 9, 2018
  • by msvitok
  • Repository
  • 4 Watchers
  • 39 Stars
  • 24,745 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 8 Open issues
  • 7 Versions
  • 13 % Grown

The README.md

WARNING: This repository is unmaintained. Please use other Laravel-Adminer packages., (*1)

Laravel-Adminer

Laravel 5 wrapper for Adminer. Adminer is an excellent database management tool in a single PHP file written by Jakub Vrana. It's a great replacement for PhpMyAdmin (also supports PostgreSQL, SQLite, MS SQL, Oracle, Firebird, SimpleDB, Elasticsearch and MongoDB)., (*2)

Usage

To include the library, go to your project's folder and run:, (*3)

composer require "miroc/laravel-adminer"

To add adminer to Laravel routes (e.g. /adminer), update routes/web.php file with:, (*4)

Route::any('adminer', '\Miroc\LaravelAdminer\AdminerController@index');

To autologin Adminer with Laravel default connection, add the following controller instead:, (*5)

Route::any('adminer', '\Miroc\LaravelAdminer\AdminerAutologinController@index');

Disabling CSRF Middleware

Adminer doesn't work with VerifyCsrfToken middleware, so it has to be disabled on its route., (*6)

Laravel 5.1+

In VerifyCsrfToken.php disable CSRF by adding adminer route to $except array:, (*7)

protected $except = [
    'adminer'
];

Laravel 5.0

The easiest way is to create a custom VerifyCsrfToken middleware that excludes selected routes:, (*8)

use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;

class CustomVerifyCsrfToken extends VerifyCsrfToken {

    protected $excludedRoutes = ['adminer'];

    public function handle($request, Closure $next)
    {
        if ($this->isExcludedRoute($request)){
            return $next($request);
        } else {
            return parent::handle($request, $next);
        }
    }

    private function isExcludedRoute($request)
    {
        if (count($request->segments()) > 0
            && in_array($request->segment(1), $this->excludedRoutes)){
            return true;
        } else {
            return false;
        }
    }
}

And then use that instead of VerifyCsrfToken in Kernel.php, (*9)

protected $middleware = [
    'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
    'Illuminate\Cookie\Middleware\EncryptCookies',
    'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
    'Illuminate\Session\Middleware\StartSession',
    'Illuminate\View\Middleware\ShareErrorsFromSession',
    'Path\To\CustomVerifyCsrfToken',
];

Remarks

Due to function name conflicts of Laravel5 and Adminer, adminer.php file functions 'cookie()', 'redirect()' and 'view()' are prefixed with 'adm_' prefix., (*10)

If you find any problem, please let me know., (*11)

The Versions

09/05 2018

dev-master

9999999-dev

Adminer (by Jakub Vrana) wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Miroslav Svitok

database management laravel5 adminer

09/05 2018

4.5.0

4.5.0.0

Adminer (by Jakub Vrana) wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Miroslav Svitok

database management laravel5 adminer

02/08 2017

4.3.1

4.3.1.0

Adminer (by Jakub Vrana) wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Miroslav Svitok

database management laravel5 adminer

02/04 2017

4.3.0

4.3.0.0

Adminer (by Jakub Vrana) wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Miroslav Svitok

database management laravel5 adminer

11/12 2016

4.2.5

4.2.5.0

Adminer (by Jakub Vrana) wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Miroslav Svitok

database management laravel5 adminer

21/02 2016

4.2.4

4.2.4.0

Adminer (by Jakub Vrana) wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Miroslav Svitok

database management laravel5 adminer

17/12 2015

4.2.3

4.2.3.0

Adminer (by Jakub Vrana) wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Miroslav Svitok

database management laravel5 adminer