Caches authenticated user information to prevent laravel query on every request.
Using composer, execute the following command to automatically update your composer.json
:
composer require thinmy/cached-eloquent-user
or manually update composer.json
{
"require": {
"thinmy/cached-eloquent-user": "^0.0.1"
}
}
After updating composer, add the ServiceProvider to the providers array in config/app.php
.
'providers' => [
Thinmy\CachedEloquentUser\AuthServiceProvider::class,
],
After updating providers, update your authentication driver in config/auth.php
.
'driver' => 'cachedEloquent`;