• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

onecentlin/laravel-adminer: Adminer database manager for Laravel 5+

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

onecentlin/laravel-adminer

开源软件地址(OpenSource Url):

https://github.com/onecentlin/laravel-adminer

开源编程语言(OpenSource Language):

PHP 100.0%

开源软件介绍(OpenSource 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' => [
        // 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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap