filagora / filagora-logs
Email logs for Filagora.
Requires
- php: ^8.4
- filagora/filagora-core: ^0.2.1
- filament/filament: ^5.0
Requires (Dev)
- filagora/filagora-entitlements: ^0.2.1
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- orchestra/testbench: ^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
Suggests
- filagora/filagora-entitlements: Answers the access check from entitlement grants. Without it, bind Filagora\Core\Contracts\AccessChecker.
Provides
None
Conflicts
None
Replaces
None
README
An email log for Filagora, as a Laravel 13 / Filament 5 plugin. Requires
filagora/filagora-core. Who may open the screen is
answered by core's AccessChecker: install
filagora/filagora-entitlements and it is
answered from entitlement grants, or bind your own checker. With neither, nobody may.
The package is at
0.1: the API may change between0.xminor versions.
What it provides
Overview
Email logs for Filagora.
Tables
email_logs, prefixed filagora_ by default. A site that already has them can run php artisan filagora:adopt instead of migrating.
Commands
This package adds no commands.
Events
This package fires no events.
Access
| Ability | Entitlement key |
|---|---|
filagora.logs.view |
filagora.logs.view |
Using it
- Email log. A read-only Filament screen over every outgoing message. When the
mail_log_sendingsetting is on (it is off by default), every outgoing message is recorded: recipients (to, cc, bcc), subject, mailer, the notification class that sent it, and its status (sending, thensentwith the message id). Logging never blocks the mail: a failure to log is reported to the application log and the message goes out. TheEmailLog::forRecipient($address)scope finds a person's rows (given spelling and lowercase; a blank address matches nothing), for privacy export and erasure. - Access. The screen is read-only and needs the
filagora.logs.viewability, mapped inconfig/filagora-logs.phpto a key of the same name (an entitlement, when entitlements is installed). Point it at your own key there. - Privacy. Logs registers a
PrivacyContributor(the rows that list a person's address, for an export or an erasure) and a retention rule that deletes rows older than the settingmail_log_retention_days(60 by default) with core. Withfilagora-complianceinstalled, privacy requests andfilagora:compliance:pruneuse them. - Message bodies are off by default (
bodies.enabledinconfig/filagora-logs.php). When on, the log keeps each message's text and shows it on the view page and in the privacy export.bodies.never_storelists the notifications whose text is never kept, because it carries a live token or signed link or private content; password reset and email verification are listed, and a site must add its own. - Table (
email_logs, prefixedfilagora_by default) matches an existing site's index for index, sophp artisan filagora:adoptaccepts it.
An audit log viewer is planned but not part of this release.
Requirements
PHP 8.4, Laravel 13 and Filament 5. Tested against MariaDB 11.4. Requires filagora/filagora-core.
Install
composer require filagora/filagora-logs
php artisan migrate
php artisan filagora:entitlements:sync # only with entitlements installed
->plugin(\Filagora\Logs\FilagoraLogsPlugin::make())
Then turn on the "Log Email Sending Activity" setting if you want the email log.
Configuration
config/filagora-logs.php is merged with the host's copy, so list only what
differs. Publish it with php artisan vendor:publish --tag=filagora-logs-config.
Extending
Extend through documented contracts, events and registries. Anything not documented
is @internal.
Testing
composer test
Tests run against a real MariaDB, never SQLite, so engine behaviour (FULLTEXT,
ONLY_FULL_GROUP_BY, collation) matches production. Host and credentials come from
your environment; the database is always named testing, never your development one.
Local development (DDEV)
.ddev/ is included. ddev start creates both db and testing (run ddev restart once
if testing is missing), then ddev exec vendor/bin/pest.
Licence
MIT. See LICENSE.