Skip to content

v4.0.0

Choose a tag to compare

@Sairahcaz Sairahcaz released this 20 May 21:17

What's changed

  • Added tracking_storage config option to support stateless / headless setups (SPAs on a separate domain, mobile apps, JWT or Sanctum token APIs). Choose between session (default, classic behavior) and cache (visitor identified by a daily IP + User-Agent hash, no session cookie required).
  • Added middleware_groups config option to control which Laravel middleware groups the CheckTracking middleware is appended to (web, api, or both).
  • Removed api* from the default except array so API routes can be tracked when explicitly opted in via middleware_groups.
  • Added SimplestatsClient::getVisitorHash() and setVisitorHash() for custom visitor lookups.
  • Dropped support for Laravel 8, 9, 10 and PHP < 8.2. Use the v3.x line 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