title: Laravel 4 error: Call to a member function passes() on a non-object
body: <p>I have a problem when using Route::post in Laravel 4.</p>
  
  <p>This is my User.php (laravel model) code:</p>
  
  <pre><code>class User extends Eloquent implements UserInterface, RemindableInterface {
  
    public static function validate($input)
    {
      $rules = array(
      'email' =&gt; 'Required|Between:3,64|Email|Unique:users',
      'password' =&gt; 'Required|AlphaNum|Between:4,8|Confirmed',
      'password_confirmation' =&gt; 'Required|AlphaNum|Between:4,8'
      );
  
      $v = Validator::make($input, $rules);
    }
  }
  </code></pre>
  
  <p>This is my routes.php code:</p>
  
  <pre><code>Route::post('register', function()
  {
    $v = User::validate(Input::all());
  
        if ($v-&gt;passes()){
        $u = new User();
        $u-&gt;email = Input::get('email');
        $u-&gt;password = Hash::make(Input::get('password'));
        $u-&gt;save();
        Auth::login($u);
  
        return Redirect::to('createprofile');
      }
      else{
        return Redirect::to('register')-&gt;withErrors($v-&gt;getMessageBag());
      }
  });
  </code></pre>
  
  <p>This is my register_user.blade.php code:</p>
  
  <pre><code>@section('content')
      {{ Form::open(array('url' =&gt; '/register', 'method' =&gt; 'post')) }}
      {{ Form::text('email') }}
      {{ Form::label('email', 'Your Email') }}&lt;/br&gt;
      {{ Form::password('password'); }}
      {{ Form::label('password', 'Your Password') }}&lt;/br&gt;
      {{ Form::password('password_confirmation'); }}
      {{ Form::label('password_confirmation', 'Confirm Your Password') }}&lt;/br&gt;
      {{ Form::submit('Go') }}
    {{ Form::close() }}
  @stop
  </code></pre>
  
  <p>The issue seems to be when the form submits to the Route::post it does not recognize </p>
  
  <pre><code>$v = User::validate(Input::all()) 
  </code></pre>
  
  <p>as a valid object, instead giving me a call to a member function passes() on a non-object.</p>
  
  <pre><code>var_dump($v)
  </code></pre>
  
  <p>comes equal to null. </p>
  
  <p>Would anyone know what the problem here is? Is User::validate() the correct way to call the function from the User model?</p>