V
V
Vadim Cherkashin2018-08-15 01:21:32
Laravel
Vadim Cherkashin, 2018-08-15 01:21:32

How to cram another middleware here?

Installed sleeping owl admin. It came to the point of restricting access there to users who are not administrators. Yes, but I don’t want to do everything through roles, there is an option to simply do something like this in the admin config file:

...

    'middleware' => ['auth','admin'],
...

Tried to do it just like this:
...

    'middleware' => ['admin'],
...

But it was not there, it gave an error saying that I am requesting an empty object.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kairat Ubukulov, 2018-08-15
@ubukulov

Route::group(['prefix' => 'admin', 'middleware' => 'auth'], function(){
     // тут все маршруты для админку
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question