filagora/filagora-logs
Filagora Logs is a Laravel package for recording and browsing application activity logs. It captures events and model changes, stores them in a searchable timeline, and provides configurable audit trails for admins and developers.
composer require <vendor>/mail-log
php artisan migrate
config/mail-log.php or .env:
MAIL_LOG_RETENTION_DAYS=60
0 disables pruning entirely — logs are kept indefinitely.EmailLog model (forRecipient() is the canonical lookup) and the package config, then at the service provider registrations for privacy contributors if you use filagora-compliance.EmailLog::forRecipient('[email protected]')->latest()->first();
From v0.2.2 you also get GDPR export/erase/prune for free when the compliance package is installed — no changes needed in your own logging code.EmailLog::forRecipient($address) for “what did we send this person?” support tickets, and standard Eloquent scopes/where clauses on subject, status, and timestamps for dashboards.EmailLogContributor is auto-registered with the host’s registries. Export/erase/prune flows go through the compliance package; your app doesn’t call the contributor directly. This keeps the mail-log package usable standalone while becoming GDPR-aware when filagora-compliance is present.logs.email_logs retention rule deletes rows older than mail_log_retention_days. Schedule the compliance prune command in routes/console.php/Kernel as you do for other retention rules; the mail-log package itself doesn’t need a scheduled command.forRecipient() does. If you have custom anonymisation jobs, run them after the compliance erase/export step, or ensure the address is captured first, otherwise the contributor can’t find the rows.to/cc/bcc fan-out, expect one row per recipient address (matching forRecipient() semantics); query per address rather than per message when handling erasure requests.EmailLog::forRecipient(...) in feature tests, and freeze time to verify retention boundaries (retention_days - 1 kept, retention_days + 1 deleted). Set mail_log_retention_days=0 in test envs if you need logs to persist across long test suites.0 means keep forever. It does not mean “delete immediately”. Use a large number or disable the rule explicitly if you want a hard stop.filagora-compliance. The contributor and retention rule are inert otherwise; retention is not enforced by the mail-log package alone. Don’t rely on mail_log_retention_days as a data-protection guarantee unless the compliance package is installed and its prune is scheduled.email first will orphan rows and break erasure. Treat anonymisation of the user record as a downstream step.forRecipient() — if you’ve customised that scope (case sensitivity, trimming, hashing), the contributor follows it. Any change there changes what gets exported/erased; review both together.forRecipient() matching (case/whitespace), and (d) whether the row was already pruned by the retention rule — pruning and erasure can race, and pruned rows are unrecoverable.How can I help you explore Laravel packages today?