Skip to content

About

Notifications toolkit: a BaseNotification that formats one message for every channel, database notification views and a latest-notifications component, model associations, icons and redirects, branded mail, optional translatable and Reverb

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Notifications

Tests codecov Latest Version on Packagist License: MIT

Notifications for Laravel, built on Laravel's own. Define what a notification says once and send it by mail, database, broadcast, FCM push and SMS (javaabu/sms-notifications), through the channels each notifiable can receive and hasn't turned off, in its own language. With a notifications page and a live bell in Blade (javaabu/forms) and Inertia React (@javaabu/forms and Onu), branded mail, Reverb or polling, and Dhivehi built in.

class OrderShippedNotification extends BaseNotification
{
    protected array $channels = ['database', 'mail', 'sms'];

    public function __construct(
        public Order $order,
    ) {}

    public function message(object $notifiable): NotificationMessage
    {
        return NotificationMessage::make(__('Your order has shipped'))
            ->line(__('Order :number is on its way.', ['number' => $this->order->number]))
            ->action(__('Track order'), route('orders.show', $this->order))
            ->subject($this->order)
            ->success();
    }
}
Route::notifications(); // the notifications page, the bell's JSON, mark read, delete
<x-notifications::bell />
<NotificationBell bell={props.notifications} />

Documentation

You'll find the documentation on https://docs.javaabu.com/docs/notifications, and in docs/. AI assistants can start from llms.txt; Laravel Boost picks up the guideline and skill in resources/boost.

Testing

composer test
pnpm install && pnpm test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@javaabu.com instead of using the issue tracker.

Credits

License

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

About

Notifications toolkit: a BaseNotification that formats one message for every channel, database notification views and a latest-notifications component, model associations, icons and redirects, branded mail, optional translatable and Reverb

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages