Test Permissions?

Posted 2 years ago by selmonal

I define my routes with a permission middleware like

Route::group(['middleware' => 'permission:manage_students'], function () {
    Route::resource('students', 'StudentsController');

    Route::put('students/{student}/password', '[email protected]');
});

Route::group(['middleware' => 'permission:manage_courses'], function () {
    //
});

How can i test it in unit test if routes requires correct permission? Please help me?

Please sign in or create an account to participate in this conversation.