Download the PHP package lvlup-dev/laravel-user-last-seen-at without Composer
On this page you can find all versions of the php package lvlup-dev/laravel-user-last-seen-at. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lvlup-dev/laravel-user-last-seen-at
More information about lvlup-dev/laravel-user-last-seen-at
Files in lvlup-dev/laravel-user-last-seen-at
Package laravel-user-last-seen-at
Short Description Adds a nullable last_seen_at column on users and middleware to update it on each authenticated request.
License MIT
Homepage https://www.lvlup.fr
Informations about the package laravel-user-last-seen-at
Laravel User Last Seen At
Store a last_seen_at timestamp on your users table and refresh it on each request for authenticated users—useful for “online recently” indicators or light activity tracking without extra tables.
Maintained by Lvlup.
Installation
You can install the package via composer:
Run the migrations (the package registers its migration automatically):
Usage
Registering the Middleware
You need to append the middleware to your route groups (e.g., the web group). In Laravel 11+, you can do this in your bootstrap/app.php file:
Note: Guests are automatically skipped, and no database write occurs for unauthenticated users.
Your User model
This package does not ship a custom User model—you keep yours.
The middleware updates the timestamp using forceFill and saveQuietly. This means:
last_seen_atdoes not need to be added to your$fillablearray.- It will not trigger any
updatedorsavedEloquent events, saving performance and preventing infinite loops in observers.
You may still want to cast it as a datetime in your User model for convenience:
Alternatives
laravel-user-last-seen-at is intentionally minimal: one nullable column and one middleware.
If you need comprehensive audit trails, rich activity feeds, or per-model event history, we recommend using spatie/laravel-activitylog or building a custom event-driven design.
Credits
laravel-user-last-seen-at is built and maintained by LVLUP. We help businesses drive operational efficiency through strategic consulting, tailored software development, and advanced AI Agent integrations.
Read this blog post (in French) on why we built this package to keep activity tracking pragmatic and efficient.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-user-last-seen-at with dependencies
illuminate/auth Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0