Search code examples
undefinedlaravel-8laravel-passportintelephense

undefined method 'createtoken'.intelephense(1013) laravel 8 API


I have added use Laravel\Passport\HasApiTokens; and use HasApiTokens in user model. Still intelephense is unable to recognise it in vs code. Also in postman when i run it it showns me error "message": "Personal access client not found. Please create one.", "exception": "RuntimeException", "file": "C:\\xampp\\htdocs\\project\\vendor\\laravel\\passport\\src\\ClientRepository.php", How can i solve it? My line for creating token is $token = Auth::user()->createToken("user_token")->accessToken;


Solution

  • Run this command.

    php artisan passport:client --personal