Monday, February 27, 2017

laravel-routing how do i convert this into Resource

Route::get('/teacher', [
   'uses' => 'AppController@getTeacherPage',
   'as' => 'teacher',
   'middleware' => 'roles',
   'roles' => ['Admin', 'Teacher']
]);

how do i convert this into Resource

I tried something like

Route::resource('teacher',TeacherController, [
   'uses' => 'TeacherController@index',
   'as' => 'teacher',
   'middleware' => 'roles',
   'roles' => ['Admin', 'Teacher']
]);




via Mark Quiambao

Advertisement