title: laravel-routing how do i convert this into Resource
body: <pre><code>Route::get('/teacher', [
     'uses' =&gt; 'AppController@getTeacherPage',
     'as' =&gt; 'teacher',
     'middleware' =&gt; 'roles',
     'roles' =&gt; ['Admin', 'Teacher']
  ]);
  </code></pre>
  
  <p>how do i convert this into Resource</p>
  
  <p>I tried something like</p>
  
  <pre><code>Route::resource('teacher',TeacherController, [
     'uses' =&gt; 'TeacherController@index',
     'as' =&gt; 'teacher',
     'middleware' =&gt; 'roles',
     'roles' =&gt; ['Admin', 'Teacher']
  ]);
  </code></pre>