Re-build the new Laravel project, find the previous Laravel Passport notes, quite an important point of knowledge, the blog did not remember, make up!

The password is used in the project to generate tokens, but there are other requirements, such as: 1. Use ‘mobile number/verification code’ to log in

These are not password methods. We can verify user login by ourselves, and then assign tokens to these users according to their IDCopy the code

Baidu search for a long time did not find, can only be searched on Google, have to say, the program this thing, or Google to force, basically can find a solution:

Laravel Passport get token by user ID, not password laravel Passport get token by user ID

Reference article: github.com/laravel/pas… Github.com/laravel/pas…

Solution: github.com/laravel/pas…

Use App\Entities\User;

Alter User model path for our own project  "Key file "file:///xxx/storage/oauth-private.key" permissions are not correct, / XXX /storage/oatuh* with/XXX /storage/oatuh* with/XXX /storage/oatuh* www:www /xxx/storage/oatuh*Copy the code