Laravel + passport how to register user?

Not found usercase how to use the passport in relation to the users.
Do I understand correctly that I create in the "users" of the user, and then in the "oauth_clients" create new client id created by the user?
Question due to the fact that maybe there are already some ready-made facades, mallary, interfaces where everything is ready and I'll start hostility.
Also there is some detailed analysis of how the passport works? Why so many tables as he uses them?
April 4th 20 at 13:28
2 answers
April 4th 20 at 13:30
Someone looking for something will always find.
Even in Russian - https://laravel.demiart.ru/create-rest-api-with-au...

And if you try, you can find even more simple solution that will have you head https://github.com/laravel/airlock

No. You don't need to do anything with his hands. Here all chewed https://laravel.ru/docs/v5/passport

To understand why so many tables you need to understand that what and why. How does oauth and oauth2
@elna56, again. HasApiTokens opened and watched. Laravel\Passport\ClientRepositor did not look, now looked. There is a create method, Yes.
But. As of and from the source to isolate the business logic - I have no idea.
My reasoning - each user has their tokens. So they are somewhere stored. If I did, they would be stored in the users. In the passport, there is a table with clients and so every user is equal your customer. Moreover, he has a field user_id. That is, registers on the site and a new user. Do it under client, which already has tokens. And these tokens with him running a third party app. And the passport comes first in the customers table, finds the token of the client and it takes the user ID.
It's all very logical, but apparently it is not. Well, that's why I'm asking. Because a concrete implementation of the passport is not obvious, it is a word at all. And in the dock too.

For this here and ask questions when things are not clear, isn't it? - Favian_OKon commented on April 4th 20 at 13:33
@Favian_OKon,
If I did, they would be stored in the users

Larabel there is out of the box, it don't need no Passport

In the passport, there is a table with clients and so every user is equal your customer.

No. Client is an application (website) which can work with your website on behalf of the user. For example you want to allow other sites to register users through your website. Also the same like to login with VK login with google. The website which will request input from your behalf is the client. And user it is already your users. Something like that around - elna56 commented on April 4th 20 at 13:36
@Favian_OKon, most likely you enough to do what I was sent https://laravel.demiart.ru/create-rest-api-with-au... and you will be enough. Well, or to use Airlock
To do what you want, write the token directly in the user table, the idea is possible, but it is better to learn to work with the more serious packages - elna56 commented on April 4th 20 at 13:39
@elna56, thank you. Here is a real help. - Favian_OKon commented on April 4th 20 at 13:42
April 4th 20 at 13:32
You can use the Password Grant Tokens, after you create the user only once to obtain access and refresh tokens with login/password, and then use them.
And where are they stored needs? I don't understand, hike, why do we need the customer entity. - Favian_OKon commented on April 4th 20 at 13:35
@Favian_OKon, Who is "they"? users in the table users, the tokens in the token table. Customers in the customer table. In this case, the client is added to once - through artisan command, and tokens are created in the SSH login/password. - luisa.Kut commented on April 4th 20 at 13:38
@luisa.Kut, thanks. I there above answered. I did not realize that the customer is some one app - Android, for example, or browsers. - Favian_OKon commented on April 4th 20 at 13:41

Find more questions by tags Laravel