samaun / laravel-notify
Beautiful, customizable toast notifications for Laravel.
v0.1.0
2026-12-02 10:22 UTC
Requires
- php: ^8.2 || ^8.3 || ^8.4 || ^8.5 || ^8.6
- illuminate/session: ^10.0 || ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^10.0 || ^11.0 || ^12.0 || ^13.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-02 10:43:15 UTC
README
A modern, customizable toast notification package for Laravel 10–13.
Installation
composer require samaun/laravel-notify php artisan vendor:publish --tag=notify-config php artisan vendor:publish --tag=notify-assets
Add to your main Blade layout:
<head> @notifyCss </head> <body> @yield('content') @notify @notifyJs </body>
Laravel usage
notify()->success('Profile updated successfully!'); notify()->error('Something went wrong.'); notify()->warning('Please check the submitted information.'); notify()->info('You have a new notification.'); notify()->success('Saved!', [ 'title' => 'Great work', 'duration' => 6000, 'position' => 'bottom-right', 'theme' => 'dark', ]);
Custom type
// config/notify.php 'types' => [ 'success' => ['accent' => '#16a34a', 'icon' => '✓'], 'premium' => ['accent' => '#8b5cf6', 'icon' => '✦'], ]; // Usage notify()->custom('premium', 'Welcome to the premium plan!', [ 'title' => 'Subscription active', 'duration' => 7000, ]);
JavaScript usage
SamaunNotify.success('Saved successfully!'); SamaunNotify.error('Request failed', { title: 'Error', duration: 7000 }); SamaunNotify.loading('Uploading your file...'); SamaunNotify.custom('premium', 'A custom toast', { accent: '#8b5cf6', icon: '✦', position: 'bottom-left' }); SamaunNotify.clear();
Livewire
Include @notifyJs in the layout. From a Livewire component:
$this->dispatch('samaun-notify', toast: [ 'type' => 'success', 'message' => 'Your profile was updated!', 'title' => 'Success', 'duration' => 5000, ]);
Options
title, duration (0 = persistent), position (top-left, top-center, top-right, bottom-left, bottom-center, bottom-right), theme (light, dark), accent, icon, dismissible, progress, progressBar, pauseOnHover, action (label, onClick, dismiss).
Development
This is an initial package scaffold. Run composer validate and add PHPUnit/Orchestra Testbench coverage before publishing to Packagist.