{"id":19324917,"url":"https://github.com/spatie/laravel-notification-log","last_synced_at":"2025-05-15T07:04:59.319Z","repository":{"id":78981223,"uuid":"605458101","full_name":"spatie/laravel-notification-log","owner":"spatie","description":"Log notifications sent by your Laravel app","archived":false,"fork":false,"pushed_at":"2025-04-22T07:44:07.000Z","size":151,"stargazers_count":188,"open_issues_count":0,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-22T08:42:40.593Z","etag":null,"topics":["history","laravel","notification","php"],"latest_commit_sha":null,"homepage":"https://spatie.be/docs/laravel-notification-log","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spatie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/support-us.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-23T07:40:29.000Z","updated_at":"2025-04-22T07:44:11.000Z","dependencies_parsed_at":"2023-06-29T06:00:20.596Z","dependency_job_id":"a47487ff-f77a-494e-b26f-6c56c45c04e1","html_url":"https://github.com/spatie/laravel-notification-log","commit_stats":{"total_commits":73,"total_committers":6,"mean_commits":"12.166666666666666","dds":0.410958904109589,"last_synced_commit":"00de6a9ddaae331c152024f2f88d522a2f5eba29"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-notification-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-notification-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-notification-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-notification-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spatie","download_url":"https://codeload.github.com/spatie/laravel-notification-log/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292039,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["history","laravel","notification","php"],"created_at":"2024-11-10T02:07:30.087Z","updated_at":"2025-05-15T07:04:54.300Z","avatar_url":"https://github.com/spatie.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Log notifications sent by your Laravel app\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-notification-log.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-notification-log)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/spatie/laravel-notification-log/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/spatie/laravel-notification-log/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/spatie/laravel-notification-log/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/spatie/laravel-notification-log/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-notification-log.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-notification-log)\n\nThis 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.\n\nIf you want to create a list of all notifications sent to a user\n\n```php\n// returns a collection of `NotificationLogItem` models\n$sentNotifications = $user-\u003eloggedNotifications();\n```\n\nIn a view, you could write this:\n\n```blade\n\u003cul\u003e\n@foreach($sentNotifications as $sentNotification)\n    \u003cli\u003e{{ $sentNotification-\u003etype }} at {{ $sentNotification-\u003ecreated_at-\u003eformat('Y-m-d H:i:s') }}\u003c/li\u003e\n@endforeach\n\u003c/ul\u003e\n```\n\nThe package also contains handy methods that allow you to make decisions based on the notifications sent. Here's an example, where we use the `wasAlreadySentTo` method provided by the package in a `shouldSent` method of a notification.\n\n```php\n// in a notification\n\npublic function shouldSend($notifiable)\n{\n      return ! $this\n        -\u003ewasAlreadySentTo($notifiable)\n        -\u003einThePastMinutes(60);\n}\n```\n\nYou can fully customize which notifications get logged and how they get logged.\n\n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/laravel-notification-log.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/laravel-notification-log)\n\nWe invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).\n\nWe 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](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).\n\n## Documentation\n\nAll documentation is available [on our documentation site](https://spatie.be/docs/laravel-notification-log).\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Freek Van der Herten](https://github.com/freekmurze)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Flaravel-notification-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspatie%2Flaravel-notification-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Flaravel-notification-log/lists"}