PHPackages                             hobbiot/cacheable-auth-user - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. hobbiot/cacheable-auth-user

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

hobbiot/cacheable-auth-user
===========================

Cache Auth::user() for Laravel 5.3. This package add new driver to laravel.

1.0.1(8y ago)131445[1 issues](https://github.com/hobbiot/cacheable-auth-user/issues)MITPHPPHP &gt;=5.6.4

Since Nov 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/hobbiot/cacheable-auth-user)[ Packagist](https://packagist.org/packages/hobbiot/cacheable-auth-user)[ RSS](/packages/hobbiot-cacheable-auth-user/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

cacheable-auth-user
===================

[](#cacheable-auth-user)

[![Latest Stable Version](https://camo.githubusercontent.com/9c78a3758567eb473ba826535fd2758e5e0e63ca8d2e0ae362a5b4b3fb065150/68747470733a2f2f706f7365722e707567782e6f72672f686f6262696f742f636163686561626c652d617574682d757365722f762f737461626c65)](https://packagist.org/packages/hobbiot/cacheable-auth-user) [![Total Downloads](https://camo.githubusercontent.com/bce4a2978718f2bcb173211cbce7cfe4d2a2598e2b7172000ff2a93aa63219d5/68747470733a2f2f706f7365722e707567782e6f72672f686f6262696f742f636163686561626c652d617574682d757365722f646f776e6c6f616473)](https://packagist.org/packages/hobbiot/cacheable-auth-user) [![Latest Unstable Version](https://camo.githubusercontent.com/5ce717ba813b9e76372d0766ba5bd4594e601eb2d2a0c8c9393eb7f9b3633bbd/68747470733a2f2f706f7365722e707567782e6f72672f686f6262696f742f636163686561626c652d617574682d757365722f762f756e737461626c65)](https://packagist.org/packages/hobbiot/cacheable-auth-user) [![License](https://camo.githubusercontent.com/2e1d752a36efad713ca40cc9490ef987262c9d2ed85e0166ac478481b241662c/68747470733a2f2f706f7365722e707567782e6f72672f686f6262696f742f636163686561626c652d617574682d757365722f6c6963656e7365)](https://packagist.org/packages/hobbiot/cacheable-auth-user)

Cacheable Auth::user() for Laravel 5.3 or 5.4.

Installation
------------

[](#installation)

Composer

```
composer require hobbiot/cacheable-auth-user

```

### Laravel

[](#laravel)

#### app.php

[](#appphp)

In your `config/app.php` add `HobbIoT\Auth\CacheableAuthUserServiceProvider::class` to the end of the `providers` array:

```
'providers' => [
    ...
        HobbIoT\Auth\CacheableAuthUserServiceProvider::class,
    ...
],
```

#### auth.php

[](#authphp)

In your `config/auth.php` change User Providers' driver. You can now use "**cacheableEloquent**".

```
...
    'providers' => [
        'users' => [
            'driver' => 'cacheableEloquent',
            'model' => App\User::class,
        ],
		// e.g.
        'admin' => [
            'driver' => 'cacheableEloquent',
            'model' => App\Administrator::class,
        ],
    ],
...
],
```

Administrator::class needs to extend Authenticatable (Illuminate\\Foundation\\Auth\\User) and use trait Notifiable (Illuminate\\Notifications\\Notifiable), just like App\\User::class.

### Supplementary Explanation

[](#supplementary-explanation)

- The cache is valid for 60 minutes.
- The cache Key is *ModelClassName*\_By\_Id\_*id* and *ModelClassName*\_By\_Id\_Token\_*id*.
- Using Eloquent *updated* event listener to clear cache, need to use `model->save()`. When user update his name in profile page, fire *updated* event automatically, (listen event and) clear cache. After that reload from resources (database).

    Laravel Official Documentation said,

> Note: When issuing a mass update via Eloquent, the *saved* and *updated* model events will not be fired for the updated models. This is because the models are never actually retrieved when issuing a mass update.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Total

4

Last Release

3267d ago

Major Versions

0.9.1 → 1.0.02016-11-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/69095b54c4e686e96d97b977fc678b9823d8486e5d4966ef25a72bcb7702809d?d=identicon)[HobbIoT](/maintainers/HobbIoT)

---

Tags

laravelauthcache

### Embed Badge

![Health badge](/badges/hobbiot-cacheable-auth-user/health.svg)

```
[![Health](https://phpackages.com/badges/hobbiot-cacheable-auth-user/health.svg)](https://phpackages.com/packages/hobbiot-cacheable-auth-user)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[pallant/laravel-aws-cognito-auth

An authentication driver for Laravel for authenticating users in AWS Cognito User Pools

777.7k](/packages/pallant-laravel-aws-cognito-auth)[yangjisen/laravel-cache-provider

105.8k1](/packages/yangjisen-laravel-cache-provider)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
