title: Trying to catch exception and redirect back with parameters
body: <p>I'm working in laravel btw.</p>
  <p>In a controller, I have some logic in a try/catch.  The logic is for looking up users by ID.  If a bad ID is searched, I want to catch and refresh the page with an error message like &quot;That user ID does not exist&quot;.</p>
  <p>I'm aware of three methods that I can use which are: <code>back()</code>, <code>Redirect::to('users')</code>, and <code>redirect()-&gt;route('users')</code>.</p>
  <p>Firstly, which should I use?</p>
  <p>Secondly, I've tried each and I get error messages or not the behavior I want.</p>
  <h2>Error Messages for Each</h2>
  <h3><code>back()</code></h3>
  <p>I don't see anything.  I redirect to the same page just fine. But the data I pass using <code>back()-&gt;withInput(['error' =&gt; $error])</code> doesn't show up on the page.  I have <code>{{isset($error) ? $error : ''}}</code> in my template waiting for an $error variable to be set. Is there a different way to do this? Better way?</p>
  <h3><code>redirect()-&gt;to('users')</code></h3>
  <p>This acts similarly to back() in that it will redirect me just fine but still I can't seem to pass data to the page.</p>
  <h3><code>redirect()-&gt;route('users')</code></h3>
  <p>This acts similarly to back() in that it will redirect me just fine but still I can't seem to pass data to the page.</p>
  <p>I imagine this is a simple problem.  I'm just new to php and laravel and could use a little direction.</p>
  <p>THANKS!</p>