Description
I am experiencing an issue where models are not being audited (with owen-it/laravel-auditing) when running Laravel with Octane on AWS Lambda using Bref. The same application works correctly in the following scenarios:
Laravel Octane enabled on a virtual server → Auditing works
Laravel Octane disabled on AWS Lambda → Auditing works
Laravel Octane enabled on AWS Lambda → Auditing does not work (OwenIt\Auditing\Events\Audited and OwenIt\Auditing\Events\Auditing are not being fired)
Expected Behavior
When an Eloquent model is updated, the owen-it/laravel-auditing package should log the changes, as it does in other environments.
Current Behavior
With Octane enabled on AWS Lambda, no audit logs are generated (OwenIt\Auditing\Events\Audited and OwenIt\Auditing\Events\Auditing are not being fired). However, model events (created, updated, deleted) are being fired correctly, which suggests the issue is specific to how the auditing package interacts with Octane in a serverless environment.
Steps to Reproduce
Deploy a Laravel 11 application to AWS Lambda using Bref with Laravel Octane enabled.
Install and configure owen-it/laravel-auditing following its documentation.
Update a model that should be audited.
Check the audit logs — they are empty.
Additional Context
The application works correctly with Octane enabled in a virtual server environment.
The application also works correctly without Octane in AWS Lambda.
The issue only occurs when Octane is enabled in AWS Lambda.
Laravel Octane’s persistent memory model might be causing event listeners not to behave as expected within AWS Lambda’s execution model.
Clearing event and configuration caches before deployment (php artisan event:clear and php artisan config:clear) does not resolve the issue.
Would appreciate any insights or possible fixes from the maintainers. Thanks in advance!