Search code examples
laravelmiddlewareentrust

Laravel 5.2 With Entrust GroupRoutes Kernel.php


I am trying to add Route::group() based on a users role.

Route::group(['middleware' => ['role:myrole']], function () {
    //Some Routes
}

I am getting this error...

Missing argument 3 for Zizaco\Entrust\Middleware\EntrustRole::handle()

I have the default install for Entrust. I am told that I need to add a line or two to the Kernel.php file in '$middlewareGroups'

What are the lines?


Solution

  • Well, the "right' way to do it was not discovered. So I used a work around. I used @role in the blade files. To me its a hack, but it works.