Download the PHP package getimmutable/laravel without Composer
On this page you can find all versions of the php package getimmutable/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download getimmutable/laravel
More information about getimmutable/laravel
Files in getimmutable/laravel
Package laravel
Short Description Laravel SDK for the Immutable audit log API.
License MIT
Informations about the package laravel
Immutable Laravel SDK
Laravel SDK for the Immutable audit log API.
Installation
The package auto-discovers its service provider. Publish the config file:
Configuration
Add the following to your .env file:
| Variable | Default | Description |
|---|---|---|
GETIMMUTABLE_API_KEY |
— | Your Immutable API key |
GETIMMUTABLE_BASE_URL |
https://api.getimmutable.com |
API base URL |
GETIMMUTABLE_ASYNC |
true |
Dispatch events via queue job |
Queue Configuration
Important: Async mode (the default) dispatches events to the
getimmutablequeue. If your queue worker is not processing this queue, events will silently sit in the queue and never be sent.
Make sure your queue worker includes the getimmutable queue:
Or if you use Laravel Horizon, add a supervisor entry in config/horizon.php:
For local development or testing, set GETIMMUTABLE_ASYNC=false to send events synchronously (no queue required).
Usage
Raw Payload
Fluent Builder (from Auth)
Fluent Builder (explicit Actor)
Resource Handling
The track() method on the builder accepts three resource types:
- Eloquent Model — auto-extracts
resource,resource_id, andresource_name(via optionalgetAuditName()method) - String — treated as the resource type name (e.g.
'Project') - null — no resource fields are included
Batch Events
Automatic Eloquent Tracking
Add the TracksEvents trait to any Eloquent model to automatically track created, updated, and deleted events:
Customize which events to track:
Events are recorded as project.created, project.updated, project.deleted (lowercased model name + event).
Testing
In your test suite, you can either:
- Set
GETIMMUTABLE_ASYNC=falseand useHttp::fake()to intercept API calls - Set
GETIMMUTABLE_ASYNC=trueand useQueue::fake()to assert jobs were dispatched
All versions of laravel with dependencies
illuminate/support Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0