When using the command line to access a database, you must be skilled and compose a complete query. A GUI-based database system may be required. Workbench, SQLPro database software, or browser-based tools like phpMyAdmin or Adminer are all options.
Adminer is a PHP-based database management tool that is simple and lightweight. It’s just one php file, thus it’s simple to use and transport. Adminer can be used with third-party plugins for MySQL, MongoDB, MariaDB, MS SQL, PostgreSQL, SQLite, Oracle, and other databases. Simply download and upload the
Adminer.php code to your server to gain access to databases.
If you wish to use the Adminer tool in your Laravel framework, you can use the Laravel Adminer Database Manager to do so. Here are some examples of how to utilise Adminer in a Laravel application.
Using the Composer command, first install the package in your Laravel application.
composer require onecentlin/laravel-adminer
Add the provider class to the ‘providers‘ array in the
'providers' => [ ... Onecentlin\Adminer\ServiceProvider::class, ... ];
app/Http/Kernel.php, add the
adminer middleware group. Instead of Authenticate, you can use your own own middleware.
protected $middlewareGroups = [ ... 'adminer' => [ \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, // use laravel default login or add your custom here \Illuminate\Auth\Middleware\Authenticate::class, ], ];
Using the artisan command, publish the package configuration file.
php artisan vendor:publish --provider="Onecentlin\Adminer\ServiceProvider"
This will duplicate the files
You can activate or disable autologin and set route prefix in the
<?php return [ 'autologin' => false, 'route_prefix' => 'adminer', ]
You can install the theme in the
You can use route to get to Adminer on your browser.
I hope you will like the content and it will help you to learn How to install Adminer in Laravel application
If you like this content, do share.