Hi,
I have problem with passport when setup in laravel 5.4 and jenssegers/mongodb package has installed.
I got error bellow when I run this code:
$user->createToken('Personal Token')->accessToken;
Error like this

Anyone help me, please!
in TokenRepository
change
public function find($id)
{
return Token::find($id);
}
to
public function find($id)
{
return Token::where('id', $id)->first();
}
@nolanle
How did you solve this problem?
I faced same issue.
It seems that it doesn't depend on MongoDB. I'm using MySQL.
https://github.com/laravel/passport/issues/713
in TokenRepository change
public function find($id)
{
return Token::find($id);
}
to
public function find($id)
{
return Token::where('id', $id)->first();
}
This is resoved my problem!
Did you try?
Still facing same issue, but on some attempts it work but fails mostly.
{
"message": "Call to a member function forceFill() on null",
"exception": "Symfony\Component\Debug\Exception\FatalThrowableError",
"file": "/var/app/current/vendor/laravel/passport/src/PersonalAccessTokenFactory.php",
"line": 75,
"trace": [
{
"file": "/var/app/current/vendor/laravel/framework/src/Illuminate/Support/helpers.php",
"line": 1041,
"function": "Laravel\Passport{closure}",
"class": "Laravel\Passport\PersonalAccessTokenFactory",
"type": "->"
},
{
"file": "/var/app/current/vendor/laravel/passport/src/PersonalAccessTokenFactory.php",
"line": 79,
"function": "tap"
},
Most helpful comment
in TokenRepository
change
public function find($id)
{
return Token::find($id);
to
public function find($id)
{
return Token::where('id', $id)->first();
}