How to install Adminer with PHP Laravel?
Today, i am going to share with you how to install adminer in laravel 5, laravel 6, laravel 7, laravel 8, laravel 9, laravel 10 and laravel 11 application. As we know adminer is similar like phpmyadmin. So if you want to install adminer in your server then follow bellow step and get full example for installation of adminer in laravel framework.
Preview:
Install Package
In this step we have to laravel-adminer package for adminer so one your cmd or terminal and fire bellow command:
composer require onecentlin/laravel-adminer
After successfully install package, open config/app.php file and add service provider and alias.
config/app.php
'providers' => [
....
Onecentlin\Adminer\ServiceProvider::class,
],
we have to also make public configuration file by following command. So run bellow command:
php artisan vendor:publish --provider="Onecentlin\Adminer\ServiceProvider"
Middleware Configuration
here we will make configuration as listed files. So just configure listed files:
app/Http/Middleware/VerifyCsrfToken.php
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'adminer'
];
}
app/Http/Kernel.php
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
.....
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
......
'api' => [
'throttle:60,1',
'bindings',
],
'adminer' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// you may create customized middleware to fit your needs
\Illuminate\Auth\Middleware\Authenticate::class,
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
.....
'adminer' => \App\Http\Middleware\Authenticate::class,
];
}
Run Project
Ok, now we are ready to run this example so quick run by following command:
php artisan serve
Now open your browser and run bellow link:
http://localhost:8000/adminer
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Laravel US State Seeder Example
- Laravel Seeder from CSV File Example
- How to Run Specific Seeder in Laravel?
- How to Run Migration and Seeder on Laravel Vapor?
- How to Change Column Length using Laravel Migration?
- Laravel Blade @includeWhen and @includeUnless Example
- Laravel Blade Include File If Exists Example
- Laravel CURL Request Example using Ixudra/curl
- Laravel - How to generate RSS Feed using roumen/feed package?
- Laravel Image Resize & Upload with Intervention Image Example
- Laravel Login with Twitter OAuth Tutorial
- Laravel Login with Google Account Tutorial
- Laravel Facebook authentication using Socialite Package
- How to Generate Dynamic Sitemap in Laravel?
- Laravel Database Backup using Laravel Backup Package