Install Adminer In PHP Laravel

Install Adminer In PHP Laravel

In this post we will give you information about Install Adminer In PHP Laravel. Hear we will give you detail about Install Adminer In PHP LaravelAnd how to use it also give you demo for it if it is necessary.

Today, i am going to share with you how to install adminer in Laravel 5 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' => [

....

OnecentlinAdminerServiceProvider::class,

],

we have to also make public configuration file by following command. So run bellow command:

php artisan vendor:publish --provider="OnecentlinAdminerServiceProvider"

Middleware Configuration

here we will make configuration as listed files. So just configure listed files:

app/Http/Middleware/VerifyCsrfToken.php

<?php


namespace AppHttpMiddleware;


use IlluminateFoundationHttpMiddlewareVerifyCsrfToken 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 AppHttp;


use IlluminateFoundationHttpKernel 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' => [

AppHttpMiddlewareEncryptCookies::class,

IlluminateCookieMiddlewareAddQueuedCookiesToResponse::class,

IlluminateSessionMiddlewareStartSession::class,

// you may create customized middleware to fit your needs

IlluminateAuthMiddlewareAuthenticate::class,

],

];


/**

* The application's route middleware.

*

* These middleware may be assigned to groups or used individually.

*

* @var array

*/

protected $routeMiddleware = [

.....

'adminer' => AppHttpMiddlewareAuthenticate::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…

Hope this code and post will helped you for implement Install Adminer In PHP Laravel. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

  +  18  =  22

We accept paid advance and paid guest Posting on our Site : Contact US