title: Laravel 5 : How to use findOrFail() method?
body: <p>I just follow some tutorial and so far what I do is :</p>
  
  <p>my <code>App/Exceptions/Handler.php</code></p>
  
  <pre><code>&lt;?php
  ...
  use Illuminate\Database\Eloquent\ModelNotFoundException;
  ...
  public function render($request, Exception $e)
  {
      if ($e instanceof ModelNotFoundException){
          abort(404);
      }
          return parent::render($request, $e);
  }
  </code></pre>
  
  <p>and my <code>UsersController</code> looks like this :</p>
  
  <pre><code>...
  public function edit($id)
  {
      $data = User::findOrFail($id);
      $roles = Role::where('title', '!=', 'Super Admin')-&gt;get();
      return View('admin.user.edit', compact(['data', 'roles']));
  }
  ...
  </code></pre>
  
  <p>with the above code if I visit <code>http://my.url/users/10/edit</code> I get <code>NotFoundHttpException in Application.php line 901:</code>, yes because there is no id 10 in my record, but with <code>User::find($id);</code> I get normal view without data, since no id 10 in my record.</p>
  
  <p>What I want is show default 404 then redirect to somewhere or return something if record not found with <code>User::findOrFail($id);</code> ? How I can do that ?</p>
  
  <p>Thanks, any help appreciated.</p>
  
  <p><code>ps: .env APP_DEBUG = true</code> </p>