For an API you would still have tokens.
You should probably take a API tutorial.
And read the chapter in the docs.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
First of all, what I am planning to reach is to write a custom auth class to auth my users without any database. Lets see I would like to load the users from a single file, or from another API calls. So do not need to use database, or eloquent for getting my users authorized.
I have seen the laravel documentation and found this page to write a customer user providers
https://laravel.com/docs/6.x/authentication#adding-custom-user-providers
But I really am stuck in this and can not get it working.
Auth::provider('riak', function ($app, array $config) {
// Return an instance of Illuminate\Contracts\Auth\UserProvider...
return new RiakUserProvider($app->make('riak.connection'));
});
What should be riak.connection ? I know riak is another service like database, but I need to use a custom one. What should I return in this function instead of return new RiakUserProvider($app->make('riak.connection')); ?
Thanks for your help
Please or to participate in this conversation.