I have been working with Laravel Entrust for several days. It turns out that when I try to validate the roles from the routes, it returns the following error:
Class App\Http\Zizaco\Entrust\Middleware\EntrustRole does not exist
Here my validation from the routes:
Route::group(['prefix' => '/', 'middleware' => ['role:admin']], function(){
//Mis rutas
});
I have done everything, just like the original documentation and I really don't know where I am making a mistake or doing a wrong step.
The definition of the middleware for the routes in
app\Http\Kernel.php
must be like this according to the documentation:If you remove the
\
one at the beginning, you are using a different namespace and the application will not find them.