mardi 21 août 2018

how to use multiple permission middleware in single method of resource controller in laravel 5.5?

I'm using Entrust Laravel 5 package. how to use index function in both the middleware in _construct function in controller below:-

Routes

Route::group(['prefix'=> 'v1', 'middleware'=> 'auth:api'], function(){

Route::resource('jobInstructionForm', 'API\V1\JobInstruction\JobInstructionController')->except('create');

});

controller

public function __construct(){

    $this->middleware('permission:manage.jobInstructions')->except('edit');
    $this->middleware('permission:approve.jobInstructionForm')->only('edit');
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire