Using middleware route filer in Entrust for Laravel

156 views Asked by At

I have used Entrust for laravel, everything works fine until I used the middleware route filter.

Like I said everything works fine apart from the middlware filter. I have added the routemiddleware array to kernel. So this is basically what the filter looks like, same thing that is found in the docs:

Route::group(['prefix' => 'admin', 'middleware' => ['role:admin']], function() {
    Route::get('/', 'AdminController@welcome');
    Route::get('/manage', ['middleware' => ['permission:manage-admins'], 'uses' => 'AdminController@manageAdmins']);
});

But I've got this error:

ReflectionException in Container.php line 779: Class role:admin does not exist

1

There are 1 answers

1
Raymond Cheng On

after you finish installation, you need run composer dump-autoload ,and make sure you follow every step of the doc