I am running CENTOS 7.3 x86_64 Apache/2.4.25
I performed all the steps per the docs: https://laravel.com/docs/5.3/passport
Locally, I can run:
$user = App\User::find(1);
// Creating a token without scopes...
$token = $user->createToken('Token Name')->accessToken;
and it creates and returns the key... however, when I deploy live I get the following:
BadMethodCallException in Builder.php line 2508:
Call to undefined method Illuminate\Database\Query\Builder::createToken()
I have asked many about this issue but no one seems to have an answer. Any help would be appreciated.
[SOLVED] - My User model on the server was missing use HasApiTokens
make sure that in User.php you have this traits use HasApiTokens,Notifiable;
Most helpful comment
[SOLVED] - My User model on the server was missing use HasApiTokens