v4.0.0
What's changed
- Added
tracking_storageconfig option to support stateless / headless setups (SPAs on a separate domain, mobile apps, JWT or Sanctum token APIs). Choose betweensession(default, classic behavior) andcache(visitor identified by a daily IP + User-Agent hash, no session cookie required). - Added
middleware_groupsconfig option to control which Laravel middleware groups theCheckTrackingmiddleware is appended to (web,api, or both). - Removed
api*from the defaultexceptarray so API routes can be tracked when explicitly opted in viamiddleware_groups. - Added
SimplestatsClient::getVisitorHash()andsetVisitorHash()for custom visitor lookups. - Dropped support for Laravel 8, 9, 10 and PHP < 8.2. Use the
v3.xline for those versions.
Migration Guide
If you are on Laravel 11+ / PHP 8.2+ and run a classic Blade, Inertia or Livewire app, upgrading to v4 is a no-op. The defaults match the previous behavior.
For headless / SPA / stateless setups, set in config/simplestats-client.php:
'middleware_groups' => ['api'],
'tracking_storage' => 'cache',See the Headless, SPA & Stateless Backends docs for the full walkthrough.
Full Changelog: v3.5.5...v4.0.0