title: Laravel validation: Call to a member function fails() on null
body: <p>This piece of code was working a few days ago but I seem to have done something to cause it to break. </p>
  
  <p>I have this route:</p>
  
  <p><code>Route::post('admin/routemanagement', 'AdminController@addRoute');</code></p>
  
  <p>Which looks like this:</p>
  
  <pre><code>    public function addRoute(Request $request) {
          if(Auth::check()) {
              $rules = [
                  'flightDep' =&gt; 'required',
                  'flightArr' =&gt; 'required',
                  'flightDepTime' =&gt; 'required',
                  'flightArrTime' =&gt; 'required',
              ];
  
              $messages = [
                  'flightDep.required' =&gt; 'A departure ICAO is required',
                  'flightArr.required' =&gt; 'An arrival ICAO is required',
                  'flightDepTime.required' =&gt; 'A departure time is required',
                  'flightArrTime.required' =&gt; 'An arrival time is required'
              ];
  
  
              $validator = $this-&gt;validate($request, $rules, $messages);
  
              if($validator-&gt;fails()) {
                  return redirect('admin/routemanagement')-&gt;withErrors($validator)-&gt;withInput();
              }
       }
  </code></pre>
  
  <p>However when this code runs, the <code>$validator</code> variable ends up null for some reason and I get the following:</p>
  
  <p><code>Call to a member function fails() on null</code></p>