Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
laragear-alerts-notify-alert
laragear-alerts-notify-alert
laragear/alerts
claude-code
notifications
alerts
alert-channel
session
queues
persist-as

Deliver Laravel Notifications as in-app frontend alerts via the AlertChannel during a web request. Exclude queued or background notifications, non-web channels like mail or database, and manual session alerts (use alerts-push for those).

Install
php artisan boost:add-skill laragear/alerts

Save this content to: .claude/skills/notify-alert/SKILL.md

# Notify via Alerts

Use when a Laravel Notification should surface in the UI as an alert.

## Channel + formatter

Add `AlertChannel::class` in `via()` and implement `toAlert()` returning an alert built with `make()`:

```php
use Laragear\Alerts\AlertChannel;
use App\Alerts\MyAlert;

public function via(object $notifiable): array
{
    return [AlertChannel::class, 'mail'];
}

public function toAlert(object $notifiable): MyAlert
{
    return MyAlert::make()
        ->set('type', 'success')
        ->set('body', 'Your report is ready!');
}
```

Always use `make()` here, never `push()`: the channel bags the alert itself, so calling `push()` would add it to the bag twice.

## Request-bound guardrail

`AlertChannel` only works within the same web request/session, because alerts live in the session bag. For notifications sent from a queued job or background process, there is no shared session for the alert to attach to — use a durable channel instead, or persist the alert (`persistAs()`) from a synchronously executed context so it survives until the user's next request.

Notify via Alerts

Use when a Laravel Notification should surface in the UI as an alert.

Channel + formatter

Add AlertChannel::class in via() and implement toAlert() returning an alert built with make():

use Laragear\Alerts\AlertChannel;
use App\Alerts\MyAlert;

public function via(object $notifiable): array
{
    return [AlertChannel::class, 'mail'];
}

public function toAlert(object $notifiable): MyAlert
{
    return MyAlert::make()
        ->set('type', 'success')
        ->set('body', 'Your report is ready!');
}

Always use make() here, never push(): the channel bags the alert itself, so calling push() would add it to the bag twice.

Request-bound guardrail

AlertChannel only works within the same web request/session, because alerts live in the session bag. For notifications sent from a queued job or background process, there is no shared session for the alert to attach to — use a durable channel instead, or persist the alert (persistAs()) from a synchronously executed context so it survives until the user's next request.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core