Weave Code
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

Toaster Laravel Package

nawasara/toaster

Lightweight Alpine-powered toast notifications for Laravel and Livewire. Add one component to your layout and trigger success/error/warning/info toasts from JavaScript, Livewire, or session flash. Configurable position, optional progress bar, dark-mode aware.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Standardized User Feedback: Eliminates fragmented toast implementations (e.g., custom jQuery plugins, inline alerts) by providing a unified, maintainable solution across Laravel/Livewire apps. Reduces cognitive load for developers and users.
  • Livewire Real-Time UX: Enables seamless feedback for async operations (e.g., form validation, API calls) without full-page reloads, improving perceived performance and engagement.
  • Dark Mode & Mobile-First Design: Aligns with modern design systems (Tailwind, Bootstrap) and ensures consistency across devices, reducing support tickets for UX issues.
  • Developer Velocity: Cuts dev time for common patterns (e.g., "show a success toast after save") from 30+ minutes (custom JS/CSS) to 5 minutes, freeing resources for high-impact features.
  • Roadmap Prioritization: Justifies deferring custom toast solutions (e.g., animated toasts, queues) until after core UX consistency is achieved. Example: "Let’s standardize on this first, then explore advanced features like toast analytics or dismissible actions."
  • Build vs. Buy: Avoids reinventing the wheel for a ubiquitous UI pattern, especially for teams with limited frontend bandwidth. MIT license ensures no vendor lock-in.
  • Cross-Team Collaboration: Provides a shared language for frontend/backend teams (e.g., "Use window.Toast.success() for this flow") and reduces merge conflicts from ad-hoc toast implementations.

When to Consider This Package

Adopt If:

  • Your app uses Laravel 10/12 + Livewire and needs lightweight, consistent notifications.
  • You prioritize developer efficiency over custom animations (e.g., no particle.js or complex transitions).
  • Your team lacks dedicated frontend resources but needs polished UX.
  • You’re building a SaaS/admin panel where UX consistency is critical (e.g., CRUD workflows, form feedback).
  • You already use Alpine.js or are open to adding it (~5KB dependency).
  • You want zero-configuration for basic toasts (drop-in Blade components).

Avoid If:

  • You need highly interactive toasts (e.g., buttons, multi-step actions). Consider laravel-notification-channels or custom solutions.
  • Your stack is non-Laravel (e.g., Vue/React) or uses PHP <8.1.
  • You require enterprise features like toast persistence, priority queues, or analytics. Evaluate toastr or laravel-notification-directives.
  • Your team is unfamiliar with Alpine.js and lacks time to onboard (though the package is self-contained).
  • You have strict bundle-size constraints (e.g., mobile-first apps where Alpine.js may be overkill).
  • Existing flash messages (e.g., Laravel’s session()->flash('status', ...)) conflict with the package’s auto-loading behavior.

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us deliver instant, polished user feedback—like a ‘saved successfully’ pop-up—across the entire app without custom development work. It’s lightweight, works on mobile and dark mode, and integrates seamlessly with our Livewire workflows. Think of it as a ‘toast notification autopilot’ that:

  • Saves dev time: Replaces ad-hoc toast implementations with a 5-minute setup.
  • Improves UX: Gives users clear feedback for actions (e.g., form submissions, API calls).
  • Reduces risk: Uses a battle-tested, Laravel-native solution instead of custom code. We’re proposing to standardize on this first, then explore advanced features like toast analytics or queues. It’s a low-risk way to elevate our product’s polish."*

For Engineers:

*"Nawasara/Toaster is a drop-in solution for Laravel/Livewire apps that gives you:

  • 4 toast types (success/error/warning/info) with 9 position options—no CSS/JS per feature.
  • Auto-flash support: Shows session messages on redirect (e.g., after Auth::login()).
  • Livewire integration: Real-time toasts via HasBrowserToast (requires nawasara/ui).
  • Alpine.js powered: ~5KB, no jQuery, works with Tailwind/Bootstrap. How to use it:
  1. Install: composer require nawasara/toaster.
  2. Add to layout:
    <x-nawasara-toaster::script />
    <x-nawasara-toaster::toaster position="top-right" />
    
  3. Trigger:
    window.Toast.success('Saved!');
    
    session()->flash('toast', ['type' => 'error', 'message' => 'Oops!']);
    

Pros:

  • Zero config, works out of the box.
  • Supports dark mode/mobile by default.
  • Extendable via Alpine store if needed. Cons:
  • Alpine.js dependency (but lightweight).
  • Livewire real-time toasts need nawasara/ui. Perfect for forms, API responses, or workflow feedback. If you need custom animations later, we can fork it."*

For Designers:

*"This package gives us a consistent, modern toast notification system that:

  • Matches our design system: Supports dark mode and responsive layouts.
  • Reduces friction: No more arguing over custom toast styles—it’s pre-built to align with our UI.
  • Saves time: Lets us focus on high-impact design decisions instead of reinventing toasts. We can tweak colors/positions globally via Alpine store, and it works on mobile/tablet. Example:
// Override default styles
window.Alpine.store('toaster', {
    defaultOptions: {
        position: 'bottom-center',
        duration: 4000,
    },
});
```"*
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor