PHPackages                             shufflingpixels/laravel-notification-action - 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. shufflingpixels/laravel-notification-action

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

shufflingpixels/laravel-notification-action
===========================================

Adds actionable endpoints for Laravel database notifications.

03PHPCI passing

Since Dec 1Pushed 5mo agoCompare

[ Source](https://github.com/shufflingpixels/laravel-notification-action)[ Packagist](https://packagist.org/packages/shufflingpixels/laravel-notification-action)[ RSS](/packages/shufflingpixels-laravel-notification-action/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Notification Action
===========================

[](#laravel-notification-action)

Adds simple, callable endpoints for Laravel database notifications. Define an action handler class, attach it to a notification via an attribute, and the package wires a `/notification-action/{notification}/{action}` route that executes the handler, optionally marking the notification as read.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10, 11, or 12

Installation
------------

[](#installation)

```
composer require shufflingpixels/laravel-notification-action
```

How it works
------------

[](#how-it-works)

1. Annotate your notification with the `#[Action(...)]` attribute, pointing to an action handler class.
2. Implement public methods on the handler; method names become callable actions.
3. The package route resolves the handler, runs the requested method with the `DatabaseNotification` model, and returns its HTTP response.
4. Returning `ShufflingPixels\NotificationAction\Http\Response::markAsRead()` marks the notification as read inside the transaction.

### Example

[](#example)

```
use Illuminate\Notifications\Notification;
use ShufflingPixels\NotificationAction\Attributes\Action;
use ShufflingPixels\NotificationAction\Http\Response;

#[Action(MyNotificationActions::class)]
class InvoicePaidNotification extends Notification {}

class MyNotificationActions
{
    public function acknowledge(DatabaseNotification $notification): Response
    {
        // Do any side effects you need...
        return Response::markAsRead(); // returns 200 and marks as read if needed
    }
}
```

Call it from the browser or an email button:

```
GET /notification-action/{notification-uuid}/acknowledge

```

Configuration
-------------

[](#configuration)

Publish the config to tweak prefix or middleware:

```
php artisan vendor:publish --tag=notification-action-config
```

Default values:

```
return [
    'prefix' => 'notification-action',
    'middleware' => ['web', 'auth'],
];
```

Routing
-------

[](#routing)

The package registers:

```
GET {prefix}/{notification}/{action}  -> NotificationActionController

```

Route model binding resolves the `DatabaseNotification` instance by ID. Missing handlers or methods return 404.

Testing
-------

[](#testing)

```
vendor/bin/phpunit
```

License
-------

[](#license)

AGPL-3.0-or-later

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance49

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/06e7f13d9bb15fe5b1d5d3585380ba9085a36924da87066a002a4f2c5fe173a1?d=identicon)[pnx](/maintainers/pnx)

---

Top Contributors

[![pnx](https://avatars.githubusercontent.com/u/398903?v=4)](https://github.com/pnx "pnx (5 commits)")

### Embed Badge

![Health badge](/badges/shufflingpixels-laravel-notification-action/health.svg)

```
[![Health](https://phpackages.com/badges/shufflingpixels-laravel-notification-action/health.svg)](https://phpackages.com/packages/shufflingpixels-laravel-notification-action)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M228](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M52](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
