Description
Lightweight, themeable toast package for Laravel & Livewire with no jQuery, Bootstrap, or Tailwind dependency.
1. Controller Usage
Trigger toast notifications from your controllers using the ToastMagic facade:
use Devrabiul\ToastMagic\Facades\ToastMagic; public function store(){ // Simple message ToastMagic::success('Successfully Created'); // Message with description ToastMagic::success('Success!', 'Your data has been saved!'); // With custom options ToastMagic::success('Success!', 'Your data has been saved!', [ 'showCloseBtn' => true, 'customBtnText' => 'View Record', 'customBtnLink' => 'https://example.com', ]); return back();}
Available toast types: success, info, warning, error
2. JavaScript Usage
Use ToastMagic directly in JavaScript for AJAX responses or client-side events:
const toastMagic = new ToastMagic(); toastMagic.success('Success!', 'Your data has been saved!');toastMagic.error('Error!', 'Something went wrong.');toastMagic.warning('Warning!', 'Check your input.', true);toastMagic.info('Info!', 'Click for details.', false, 'Learn More', 'https://example.com');
Signature: toastMagic.{type}(heading, description, showCloseBtn, customBtnText, customBtnLink)
Recent Courses on Laravel Daily
[NEW] Practical Laravel Security: Packages, Secrets, Supply-Chain Attacks
7 lessons
43 min read
AI Agents/IDEs for Laravel: May 2026 (Claude Code, Codex, OpenCode, etc)
7 lessons
52 min
Roles and Permissions in Laravel 13
14 lessons
57 min