New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

spatie/laravel-notification-log

Log notifications sent by your Laravel app
1,335,587 212
Install
composer require spatie/laravel-notification-log
Latest Version:1.4.1
PHP:^8.4
Laravel:12 · 13
Older releases:10 · 11
License:MIT
Last Updated:Oct 22, 2026
Links: GitHub  ·  Packagist
Maintainer: spatie
Logo for laravel-notification-log

Log notifications sent by your Laravel app

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package will log all the notifications sent by your app. This will allow you to write logic based on the notifications your app has sent.

If you want to create a list of all notifications sent to a user

// returns a collection of `NotificationLogItem` models
$sentNotifications = $user->loggedNotifications();

In a view, you could write this:

<ul>
@foreach($sentNotifications as $sentNotification)
    <li>{{ $sentNotification->type }} at {{ $sentNotification->created_at->format('Y-m-d H:i:s') }}</li>
@endforeach
</ul>

The package also contains handy methods that allow you to make decisions based on the notifications sent. Here's an example, where we use the wasSentTo method provided by the package in a shouldSend method of a notification.

// in a notification

public function shouldSend($notifiable)
{
      return ! $this
        ->wasSentTo($notifiable)
        ->inThePastMinutes(60);
}

You can fully customize which notifications get logged and how they get logged.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Documentation

All documentation is available on our documentation site.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

spatie/elasticsearch-search-string-parser

Build Elasticsearch queries based of a query string

24,278 51
spatie/backtrace

A better backtrace

208,709,058 437
spatie/laravel-package-tools

Tools for creating Laravel packages

185,188,882 951
spatie/image-optimizer

Easily optimize images using PHP

93,761,798 2,882
spatie/error-solutions

This is my package error-solutions

83,359,997 66

Version History

Version Released PHP Laravel License
1.4.1 ^8.4 ^12.0|^13.0 MIT
1.4.0 ^8.4 ^12.0|^13.0 MIT
1.3.3 ^8.1|^8.2 ^10.0|^11.0|^12.0 MIT
1.3.2 ^8.1|^8.2 ^10.0|^11.0|^12.0 MIT
1.3.1 ^8.1|^8.2 ^10.0|^11.0 MIT