I am using Zizaco.Entrust ACL in one of my project, But i am getting HttpException while applying Zizaco Entrust middleware on route. It look like i have missed something.
Here in my route and kernal .php files.
Kernel.php
....
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'role' => \Zizaco\Entrust\Middleware\EntrustRole::class,
'permission' => \Zizaco\Entrust\Middleware\EntrustPermission::class,
'ability' => \Zizaco\Entrust\Middleware\EntrustAbility::class,
];
....
route.php
.....
Route::get('/', 'HomeController@index');
Route::group(['middleware' => ['web']], function () {
Route::get('login/','UserController@loginForm');
Route::post('login/','UserController@login');
Route::get('logout/','UserController@logout');
});
Route::group(['middleware' => ['web','role:admin']], function () {
Route::get('register/','UserController@register');
Route::post('register/','UserController@store');
Route::get('home/',['as' => 'home', 'uses' => 'HomeController@index']);
});
....
I did not understand i have follow almost tutorial available on github and still i am getting this error.
I have searched on internet related to this issue, but i did not found any solution.
Please help me.
Thanks.