You can go with passport, or a very simple token based api.
Laravel, out of the box, is setup for the token based one.
If you add an 'api_token' field to your user migration, and seed it, any request going to an API route with an 'api_token' header will be authenticated as that user.
In bigger production systems however, installing Passport should be preferred and is very easily installed
If you add an 'api_token' field to your user migration, and seed it, any request going to an API route with an 'api_token' header will be authenticated as that user.
Thank You for this information. There is not anywhere this information.
Yes Passport looks much better. But I want just to test what laravel offer by default.
If you add an 'api_token' field to your user migration, and seed it, any request going to an API route with an 'api_token' header will be authenticated as that user.
@lostdreamer_nl I suppose api_token is a string, how much long should be? or doesn't matter and I can set any?