title: Laravel 5 Redirect After Logout - How to Redirect Back?
body: <p>I want to redirect back to where the user has been, after he logs out successfully, because I have methods that are accessible even if logged out.</p>
  
  <p>I guard every method in my <strong>PhotosController</strong> except <strong>@show</strong></p>
  
  <pre><code>public function __construct()
  {
      $this-&gt;middleware('auth', ['except' =&gt; 'show']);
  }
  </code></pre>
  
  <p>To set the redirect after logout I set the property in my <strong>AuthController</strong> like this:</p>
  
  <pre><code>protected $redirectAfterLogout = '/customLogoutPage';
  </code></pre>
  
  <p>But I want to redirect the user back to where he has been, since he can see the View even without being locked in.</p>
  
  <p>I tried something in this direction:</p>
  
  <pre><code>protected $redirectAfterLogout = redirect()-&gt;back();
  </code></pre>
  
  <p>But my browser says: "Unexpected '(', expecting ',' or ';'</p>
  
  <p>How is it possible to use a redirect back to the view where the user has been, before he logged out.</p>