title: Laravel 5.6 Method Illuminate\Database\Query\Builder::createToken does not exist
body: <p>I am trying to create API authentication using Passport but I can not seem to create a token when a user is being registered using <strong>createToken</strong>().</p>
  
  <p>I have already checked I have included HasApiTokens but still gives same error. </p>
  
  <p><strong>ERROR</strong></p>
  
  <blockquote>
    <p>Method Illuminate\Database\Query\Builder::createToken does not exist</p>
  </blockquote>
  
  <p><strong>App\User</strong></p>
  
  <pre><code>namespace App;
  
  use Laravel\Passport\HasApiTokens;
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
      use HasApiTokens, Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name', 'email', 'password',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
            'password', 'remember_token',
      ];
  }
  </code></pre>
  
  <p><strong>SignupController</strong></p>
  
  <pre><code>**public function userLogin(Request $request) 
  {
      $email = $request-&gt;email;
      $password = $request-&gt;password;
  
      $user = User::where('email' , $email)-&gt;where( 'password' , $password);
      if($user)
      {
          $token = $user-&gt;createToken('MyApp')-&gt;accessToken;
          $arr = array('token' =&gt; $token, 'status' =&gt; 'isTrue', 'userId' =&gt; $data[0]-&gt;id);
          //return response()-&gt;json($arr , 200);
      }**
  }
  </code></pre>