Giter Club home page Giter Club logo

laravel-adminer's Introduction

Laravel Adminer Database Manager

Light weight Adminer database management tool integrated into Laravel 5/6/7/8/9.

Various database support: MySQL, SQLite, PostgreSQL, Oracle, MS SQL, Firebird, SimpleDB, MongoDB, Elasticsearch, and etc.

v6.0 New Features

Make life easier with minimized package setup =)

  • Enable laravel auto package discovery
  • New config setting: middleware (default value: auth)
  • Enable env variables to setup adminer config
    • ADMINER_ENABLED
    • ADMINER_AUTO_LOGIN
    • ADMINER_ROUTE_PREFIX

Installation

composer require onecentlin/laravel-adminer

OR

Update composer.json in require section:

"require": {
    "onecentlin/laravel-adminer": "^6.0"
},

Run:

composer update onecentlin/laravel-adminer

Register package

Laravel auto package discovery feature added since package v6.0, you may skip this step.

Update config/app.php

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

Publish config and theme file

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

This action will copy two files:

  • config/adminer.php - Adminer config file
  • public/adminer.css - Adminer theme file

config file: config/adminer.php

<?php

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

ATTENSION: Please only enable autologin with authenticated protection.

theme file: public/adminer.css

You may download adminer.css from Adminer or create custom style, and place it into public folder.

Setup Access Permission (Middleware)

Package v6.0 allow customized middleware config, you may skip this step or modify to fit your needs.

Laravel 5.2 and above

Setup for middleware group supported for Laravel 5.2 above

Modify config/adminer.php : 'middleware' => 'adminer',

Modify app/Http/Kernel.php file with adminer in $middlewareGroups

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,
    ],
];

Access adminer

Open URL in web browser

http://[your.domain.com]/adminer

Screenshot

Remarks

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

Inspired by miroc

laravel-adminer's People

Contributors

onecentlin avatar gahlawat avatar mattsches avatar revolta77 avatar egorgruzdev avatar hirbod avatar laravel-shift avatar huszerldani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.