Skip to content

Instantly share code, notes, and snippets.

@nullproduction
nullproduction / CachedEloquentUserProvider.php
Last active May 9, 2022 10:31
Caching Auth::user() for Laravel5
<?php namespace App\Providers;
use Illuminate\Contracts\Hashing\Hasher;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Auth\Authenticatable;
class CachedEloquentUserProvider implements UserProvider {
protected $hasher;
protected $model;