title: Laravel 5.6 - Get Route By Name In Controller
body: <p>Within my login controller there is a hardcoded URL string which sets where to redirect to once the user has logged in. I am trying to make this dynamic by getting the route by name:</p>
  
  <pre><code>protected $redirectTo = '/home';
  </code></pre>
  
  <p>Updated To:</p>
  
  <pre><code>protected $redirectTo = route('home');
  </code></pre>
  
  <p>However the above give the following error:</p>
  
  <blockquote>
    <p>FatalErrorException (E_UNKNOWN)
    Constant expression contains invalid operations</p>
  </blockquote>
  
  <p>Is it possible to get the URL to the route by its name?</p>