Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

> haddad_zineddine's avatar

Laravel Passport

Hello , when i use this statement in login class : $success['token'] = Auth::user()->createToken('MyApp')->accessToken; it show me : undefined methode createToken

But it work correctly in registre class

so can someone help me ?

0 likes
6 replies
> haddad_zineddine's avatar

@tisuchi it work correctly and it give me access token correctly , but vs code show me that this methode is undefined i don't know why

tisuchi's avatar

@jokerdz if the issue showing in the vs code only, then just ignore it. As long as it works fine in your application and returns the right data.

1 like

Please or to participate in this conversation.