title: laravel controller cannot use currentRouteName() inside construce()
body: <p>I have named routes:<br>
  <code>admin.post.category</code><br>
  <code>admin.post.tag</code><br>
  <code>admin.post.theme</code>     </p>
  
  <p>routes\admin.php</p>
  
  <pre><code>Route::group(['prefix' =&gt; 'post', 'as' =&gt; 'post.'], function () {
      Route::resource('category', 'Admin\Post\TermsController');
      Route::resource('theme', 'Admin\Post\TermsController');
      Route::resource('tag', 'Admin\Post\TermsController');
  });
  </code></pre>
  
  <p>Http\Controller\Admin\Post\TermsController</p>
  
  <pre><code>public function __construct(Request $request)
  {
      $this-&gt;request = $request;
  
      $route_name = Route::currentRouteName();
      $arr = explode('.', $route_name);
      echo "&lt;pre&gt;".print_r($arr[2], 1)."&lt;/pre&gt;"; exit;
  
  }
  </code></pre>
  
  <p>When I visit the page <a href="http://localhost/admin/post/category" rel="nofollow noreferrer">http://localhost/admin/post/category</a>, it can show category. But when I run command  </p>
  
  <pre><code>php artisan route:list
  </code></pre>
  
  <p>It shows</p>
  
  <pre><code>  [ErrorException]
    Undefined offset: 2
  </code></pre>
  
  <p>If I move the three lines from __construct() to index()  </p>
  
  <pre><code>$route_name = Route::currentRouteName();
  $arr = explode('.', $route_name);
  echo "&lt;pre&gt;".print_r($arr[2], 1)."&lt;/pre&gt;"; exit;
  </code></pre>
  
  <p>Then "php artisan route:list" runs well.</p>
  
  <p>How to fix this?</p>