okaufmann / laravel-notification-log
Logs every sent Notification and Mail of your entire Project.
4.6.0
2024-10-01 18:49 UTC
Requires
- php: ^8.3
- ext-zlib: *
- illuminate/contracts: ^11.0
- nesbot/carbon: ^2.64|^3.6
- spatie/laravel-package-tools: ^1.13.0
- spatie/regex: ^3.1
Requires (Dev)
- larastan/larastan: ^2.9
- laravel-notification-channels/telegram: ^5.0
- laravel-notification-channels/twilio: ^3.4
- laravel-notification-channels/webpush: ^9.0
- laravel/pint: ^1.0
- laravel/slack-notification-channel: ^3.2
- laravel/vonage-notification-channel: ^3.0
- orchestra/testbench: ^9.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.4
- phpunit/phpunit: ^11.0
- spatie/test-time: ^1.3
README
Logs every sent Notification of your entire Laravel Project.
Installation
You can install the package via composer:
composer require okaufmann/laravel-notification-log
You can publish and run the migrations with:
php artisan vendor:publish --tag="notification-log-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="notification-log-config"
The following config file will be published in config/notification-log.php:
return [ /* |-------------------------------------------------------------------------- | Resolve Notification Message |-------------------------------------------------------------------------- | | If this is enabled, the Logger will try to resolve the built message | out of the notification. This is useful if you want to debug your | sent notifications. | */ 'resolve_notification_message' => env('NOTIFICATION_LOG_RESOLVE_NOTIFICATION_MESSAGE', false), ];
Usage
Add the following Interface and Trait to your Notification:
use Okaufmann\LaravelNotificationLog\Contracts\ShouldLogNotification;use Okaufmann\LaravelNotificationLog\Models\Concerns\LogsNotifications; class DummyNotification extends Notification implements ShouldLogNotification { use LogsNotifications; // ... }
Now send a Notification or Mail as you would normally do. The package will automatically log the Notification or Mail.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.