PHPackages                             jamesmills/laravel-notification-rate-limit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. jamesmills/laravel-notification-rate-limit

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

jamesmills/laravel-notification-rate-limit
==========================================

Rate limiter to avoid flooding users with duplicate notifications.

3.3.0(1mo ago)4838.0k↑47%11MITPHPPHP ^8.2CI passing

Since May 12Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/jamesmills/laravel-notification-rate-limit)[ Packagist](https://packagist.org/packages/jamesmills/laravel-notification-rate-limit)[ Docs](https://github.com/jamesmills/laravel-notification-rate-limit)[ RSS](/packages/jamesmills-laravel-notification-rate-limit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (20)Used By (0)

Laravel Notification Rate Limit
===============================

[](#laravel-notification-rate-limit)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e38dbf863a0c92fbca27265624087fe766c53e28ff2690fe2c06661ba8c3589c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a616d65736d696c6c732f6c61726176656c2d6e6f74696669636174696f6e2d726174652d6c696d69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jamesmills/laravel-notification-rate-limit)[![Total Downloads](https://camo.githubusercontent.com/1748dbadf246d77540b1a0b4e405e4a1c11f3dabb5c42582745ff0b262a0bbb4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a616d65736d696c6c732f6c61726176656c2d6e6f74696669636174696f6e2d726174652d6c696d69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jamesmills/laravel-notification-rate-limit)[![Quality Score](https://camo.githubusercontent.com/c601062fe1307cd02d390463bfa6f6da7f6f79dc383ce4966b8a88e2dab87182/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6a616d65736d696c6c732f6c61726176656c2d6e6f74696669636174696f6e2d726174652d6c696d69742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/jamesmills/laravel-notification-rate-limit)[![StyleCI](https://camo.githubusercontent.com/512751dd31d6a0fdcb54f1600bc318a85460c6f933d7f05967185b7f381bd8e1/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3236323735343330392f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/262754309)[![Tests](https://github.com/jamesmills/laravel-notification-rate-limit/actions/workflows/tests.yml/badge.svg)](https://github.com/jamesmills/laravel-notification-rate-limit/actions/workflows/tests.yml)

[![Licence](https://camo.githubusercontent.com/b85262119b806896cefe1196682050e120db06807fbc752345519473d050502a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a616d65736d696c6c732f6c61726176656c2d6e6f74696669636174696f6e2d726174652d6c696d69742e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/b85262119b806896cefe1196682050e120db06807fbc752345519473d050502a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a616d65736d696c6c732f6c61726176656c2d6e6f74696669636174696f6e2d726174652d6c696d69742e7376673f7374796c653d666c61742d737175617265)[![Buy us a tree](https://camo.githubusercontent.com/dc3f77a9b22c3bc83c7b7d863bf138a7ca3418f1826b0b16d073d0aa87c16bc4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74726565776172652d2546302539462538432542332d6c69676874677265656e3f7374796c653d666c61742d737175617265)](https://plant.treeware.earth/jamesmills/laravel-notification-rate-limit)[![Treeware (Trees)](https://camo.githubusercontent.com/787fa3376fffd4df89b960a8d70859e5264e7488892c884ae2147d0e0c3151ba/68747470733a2f2f696d672e736869656c64732e696f2f74726565776172652f74726565732f6a616d65736d696c6c732f6c61726176656c2d6e6f74696669636174696f6e2d726174652d6c696d69743f7374796c653d666c61742d737175617265)](https://plant.treeware.earth/jamesmills/laravel-notification-rate-limit)

Rate Limiting Notifications in Laravel using Laravel's native rate limiter to avoid flooding users with duplicate notifications.

Version Compatability
---------------------

[](#version-compatability)

LaravelPHPLaravel-Notification-Rate-LimitDate7.x/8.x7.1/8.01.1.02021-05-209.x8.02.1.02023-08-2610.x8.0/8.12.1.02023-08-2610.x-13.x8.2-8.43.3.02026-03-22Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jamesmills/laravel-notification-rate-limit
```

### Update your Notifications

[](#update-your-notifications)

Implement the `ShouldRateLimit` interface and add the `RateLimitedNotification` trait to the Notifications you would like to rate limit.

```
