Open dragonplunker opened 2 years ago
@dragonplunker You may setup your own middleware groups
Please check v5.4.0 readme (https://github.com/onecentlin/laravel-adminer/tree/5.4.0)
I've had the same issue when using only the default 'auth' middleware. In my case I also had to apply the 'web' middleware to the config/adminer.php
file:
'middleware' => ['web', 'auth'],
Hi @Vinze
If you are not using global middleware including \Illuminate\Session\Middleware\StartSession::class
I'll recommend you use middlewareGroups, you may adjust to fit your needs.
Checkout README - Setup Access Permission (Middleware)
config/adminer.php
'middleware' => 'adminer',
app/Http/Kernel.php
protected $middlewareGroups = [
...
'adminer' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Session\Middleware\StartSession::class,
// Laravel default authentication (default protection)
\Illuminate\Auth\Middleware\Authenticate::class,
],
];
Hi @onecentlin,
I have updated from the version from Miroc to your version. I have a question regarding middleware. In the old setup I used:
Route::middleware('role:Administrator')->group(function () {
/*
|--------------------------------------------------------------------------
| ADMINER
|--------------------------------------------------------------------------
*/
Route::any('adminer', [\Miroc\LaravelAdminer\AdminerAutologinController::class, 'index']);
});
That way it required the role of administrator to work. I am not sure how I can achieve the same thing with your setup. Can you provide some guidance?
i use auth as middleware but not working, whenever i access adminer route it keep kick me and cannot let me in