PHPackages                             devrabiul/laravel-toaster-magic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. devrabiul/laravel-toaster-magic

ActiveLibrary

devrabiul/laravel-toaster-magic
===============================

Laravel Toaster Magic is a lightweight, flexible toast library for Laravel projects, with no jQuery, Bootstrap, or Tailwind dependency.

v2.0(4mo ago)22351.5k—10%131MITCSS

Since Apr 8Pushed 3mo ago7 watchersCompare

[ Source](https://github.com/devrabiul/laravel-toaster-magic)[ Packagist](https://packagist.org/packages/devrabiul/laravel-toaster-magic)[ Docs](https://github.com/devrabiul/laravel-toaster-magic)[ RSS](/packages/devrabiul-laravel-toaster-magic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (14)Used By (1)

🍞 ToastMagic - Laravel Toaster (v2.0 - With Livewire v3 &amp; v4 Support)
=========================================================================

[](#-toastmagic---laravel-toaster-v20---with-livewire-v3--v4-support)

Laravel Toaster Magic is a lightweight and flexible toast notification package for Laravel applications — built with zero dependencies on jQuery, Bootstrap, or Tailwind. It’s fully compatible with Livewire (v3 &amp; v4), supports custom events, and now features multiple modern themes like iOS, Glassmorphism, and Neon for a premium UX out of the box.

[![Latest Stable Version](https://camo.githubusercontent.com/a8ff2b2f9edfd804248aa6119abd401034aa8ee49f968bb007ae317dbf0e6603/68747470733a2f2f706f7365722e707567782e6f72672f64657672616269756c2f6c61726176656c2d746f61737465722d6d616769632f762f737461626c65)](https://packagist.org/packages/devrabiul/laravel-toaster-magic)[![Total Downloads](https://camo.githubusercontent.com/5041f002bac594402763148a4d677a8b13db89c2d26005a91a9a1fe5e85ac383/68747470733a2f2f706f7365722e707567782e6f72672f64657672616269756c2f6c61726176656c2d746f61737465722d6d616769632f646f776e6c6f616473)](https://packagist.org/packages/devrabiul/laravel-toaster-magic)[![Monthly Downloads](https://camo.githubusercontent.com/a3466b5b350781e208f71c05ecd60db65dc60880ef9a1d6eea7890464403df2b/68747470733a2f2f706f7365722e707567782e6f72672f64657672616269756c2f6c61726176656c2d746f61737465722d6d616769632f642f6d6f6e74686c79)](https://packagist.org/packages/devrabiul/laravel-toaster-magic)[![GitHub license](https://camo.githubusercontent.com/5629272e087524c8d6ff042aebb16994d2b3bd1f8a436bf1a17ee4a0655555b4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f64657672616269756c2f6c61726176656c2d746f61737465722d6d61676963)](https://camo.githubusercontent.com/5629272e087524c8d6ff042aebb16994d2b3bd1f8a436bf1a17ee4a0655555b4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f64657672616269756c2f6c61726176656c2d746f61737465722d6d61676963)[![Buy us a tree](https://camo.githubusercontent.com/130148911f548b001b2ac68a32c0a06559977ca60ada3bf480c72ae4ea093175/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d6c69676874677265656e)](https://plant.treeware.earth/devrabiul/laravel-toaster-magic)[![GitHub Repo stars](https://camo.githubusercontent.com/6edaae3ba09979d185257e9f2c997eeeaa8de24cdf5db5683f9cdba358415f10/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f64657672616269756c2f6c61726176656c2d746f61737465722d6d616769633f7374796c653d736f6369616c)](https://camo.githubusercontent.com/6edaae3ba09979d185257e9f2c997eeeaa8de24cdf5db5683f9cdba358415f10/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f64657672616269756c2f6c61726176656c2d746f61737465722d6d616769633f7374796c653d736f6369616c)

---

🚀 Live Demo
-----------

[](#-live-demo)

👉 [Try the Live Demo](https://rixetbd.com/docs?package=laravel-cookie-consent)

[![Live Demo Thumbnail](https://camo.githubusercontent.com/4dc038c1f81a45f56db2d1ae52cff58a465ab2f22311ef6b68aa713adea12253/68747470733a2f2f726978657462642e636f6d2f73746f726167652f6170702f7075626c69632f7061636b6167652f64657672616269756c2f6c61726176656c2d746f61737465722d6d616769632e77656270)](https://camo.githubusercontent.com/4dc038c1f81a45f56db2d1ae52cff58a465ab2f22311ef6b68aa713adea12253/68747470733a2f2f726978657462642e636f6d2f73746f726167652f6170702f7075626c69632f7061636b6167652f64657672616269756c2f6c61726176656c2d746f61737465722d6d616769632e77656270)

---

✨ Features
----------

[](#-features)

- 🔥 **Easy-to-Use** – Simple and intuitive toast notifications for Laravel.
- 🌍 **RTL Support** – Full compatibility with right-to-left (RTL) languages.
- 🌙 **Dark Mode** – Seamless dark mode integration.
- 🎨 **Themeable** – Choose from 7+ stunning themes including iOS, Neon, and Glassmorphism.
- ⚡ **Livewire v3 &amp; v4 Ready** – Fully supports Livewire v3 &amp; v4 with event-based dispatching.

---

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require devrabiul/laravel-toaster-magic
```

Then publish the package assets:

```
php artisan vendor:publish --provider="Devrabiul\ToastMagic\ToastMagicServiceProvider"
```

---

⚙️ Usage
--------

[](#️-usage)

### 1. Basic Setup

[](#1-basic-setup)

Include the necessary assets in your layout Blade template:

**In the `` section:**

```
{!! ToastMagic::styles() !!}
```

**Before the closing `` tag:**

```
{!! ToastMagic::scripts() !!}
```

**Example:**

```

    Page

    {!! ToastMagic::styles() !!}

    {!! ToastMagic::scripts() !!}

```

---

### 2. Usage in Controller

[](#2-usage-in-controller)

Trigger toast notifications from your controllers using the `ToastMagic` facade:

```
use Devrabiul\ToastMagic\Facades\ToastMagic;

public function store()
{
    // Your logic
    ToastMagic::success('Successfully Created');

    // Another Way - message and description
    ToastMagic::success("Success!", "Your data has been saved!");

    // Another Way - message and description
    ToastMagic::success("Success!", "Your data has been saved!", [
        'showCloseBtn' => true,
        'customBtnText' => 'Link Text',
        'customBtnLink' => 'https:/demo.com',
    ]);
    return back();
}
```

---

### 3. Usage in JavaScript (Optional)

[](#3-usage-in-javascript-optional)

Use ToastMagic directly in JavaScript (for AJAX responses, etc.):

```
const toastMagic = new ToastMagic();

// Basic notifications
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");
```

---

### 4. ✅ Livewire Support (v3 &amp; v4)

[](#4--livewire-support-v3--v4)

Enable Livewire support by updating your config file:

```
// config/laravel-toaster-magic.php

return [
    'options' => [
        // your toast options...
    ],
    'livewire_enabled' => true,
    'livewire_version' => 'v3', // Supports 'v3' or 'v4'
];
```

- Set `'livewire_enabled' => true` to activate Livewire integration.
- Set `'livewire_version' => 'v3'` to specify the Livewire version.

---

**Dispatch toast notifications from Livewire components:**

```
$this->dispatch('toastMagic',
    status: 'success',
    title: 'User Created',
    message: 'The user has been successfully created.',
    options: [
        'showCloseBtn' => true,
        'customBtnText' => 'Link Text',
        'customBtnLink' => 'https:/demo.com',
    ],
);

$this->dispatch('toastMagic',
    status: 'info',
    title: 'User Created 2',
    message: 'The user has been successfully created.'
);
```

**Supported status types:** `success`, `info`, `warning`, `error`

---

### 5. 🎨 Themes (New in v2.0)

[](#5--themes-new-in-v20)

ToastMagic v2.0 introduces a powerful theming system. You can switch themes globally via the config file.

**Available Themes:**

- **`default`**: The classic, clean look.
- **`material`**: Material Design inspired, flat and bold.
- **`ios`**: Apple-style notifications with blur/backdrop effects (Glassmorphism lite).
- **`glassmorphism`**: Heavy blur, semi-transparent backgrounds, modern aesthetic.
- **`neon`**: Dark, glowing borders and vibrant colors—perfect for dark mode apps.
- **`minimal`**: Clean, borderline design with colored left accents.
- **`neumorphism`**: Soft UI shadows and extruded plastic look.

**How to Change Theme:**

Update your `config/laravel-toaster-magic.php` file:

```
// config/laravel-toaster-magic.php

return [
    'options' => [
        // other options..
        "theme" => "default", // Options: "default", "material", "ios", "glassmorphism", "neon", "minimal", "neumorphism"
    ],
    // other settings..
];
```

---

### 6. 🎨 Enabling Color Mode

[](#6--enabling-color-mode)

ToastMagic supports a **color mode** that dynamically applies toast colors based on the toast type (`success`, `error`, `warning`, `info`). This makes your notifications visually consistent and meaningful without manually specifying colors or themes.

Enable color mode in your configuration file `config/laravel-toaster-magic.php`:

```
return [
    'options' => [
        // other options...
        'color_mode' => true, // Automatically apply colors based on toast type
    ],
    'livewire_enabled' => false,
    'livewire_version' => 'v3',
];
```

### 7. 🎨 Enabling Gradient Mode

[](#7--enabling-gradient-mode)

Laravel Toaster Magic now supports a **gradient mode**, which dynamically applies toast colors based on the toast type (`success`, `error`, `warning`, `info`). This ensures that your notifications are visually consistent and meaningful **without manually specifying colors or themes**.

To enable gradient mode, update your configuration file `config/laravel-toaster-magic.php`:

```
return [
    'options' => [
        // other options...
        "gradient_enable" => true, // Adds subtle gradients to backgrounds
    ],
    'livewire_enabled' => false,
    'livewire_version' => 'v3',
];
```

> **Note:** Gradient mode works best with the **default**, **material**, and **neon** themes.

---

🧩 Alternative Syntax &amp; Fluent API
-------------------------------------

[](#-alternative-syntax--fluent-api)

ToastMagic provides both simple and advanced APIs to suit your style.

### 🔹 Static Method (Quick)

[](#-static-method-quick)

```
use Devrabiul\ToastMagic\Facades\ToastMagic;

ToastMagic::success('Operation Successful');
ToastMagic::error('Something went wrong');
```

### 🔹 Fluent Syntax (Advanced)

[](#-fluent-syntax-advanced)

```
ToastMagic::dispatch()->success(
    'User Created',
    'The user has been successfully created.',
    [
        'showCloseBtn'    => true,
        'customBtnText'   => 'View Profile',
        'customBtnLink'   => 'https://demo.com',
    ]
);
```

---

📍 Toast Position Options
------------------------

[](#-toast-position-options)

Customize toast display position using any of the following:

PositionDescription`toast-top-start`Top left corner`toast-top-end`Top right corner (default)`toast-top-center`Top center`toast-bottom-start`Bottom left corner`toast-bottom-end`Bottom right corner`toast-bottom-center`Bottom center---

🌙 Enable Dark Mode
------------------

[](#-enable-dark-mode)

Add `theme="dark"` to your `` tag to automatically enable dark mode.

```

```

🎯 Get Started Today!
--------------------

[](#-get-started-today)

Experience the magic of ToastMagic and enrich your Laravel application with modern, elegant toast notifications.

- 🔗 **GitHub:** [devrabiul/laravel-toaster-magic](https://github.com/devrabiul/laravel-toaster-magic)
- 🔗 **Live Demo:** [laravel-toaster-magic.rixetbd.com](https://laravel-toaster-magic.rixetbd.com)
- 🔗 **Packagist:** [packagist.org/packages/devrabiul/laravel-toaster-magic](https://packagist.org/packages/devrabiul/laravel-toaster-magic)

---

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please fork the repository, make your changes, and submit a pull request. For feature requests or issues, [open a GitHub issue](https://github.com/devrabiul/laravel-toaster-magic/issues).

---

📄 License
---------

[](#-license)

This package is open-source software licensed under the [MIT license](LICENSE).

---

🌱 Treeware
----------

[](#-treeware)

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/devrabiul/laravel-toaster-magic) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

---

📬 Contact
---------

[](#-contact)

For support or inquiries, feel free to reach out: 📧

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance79

Regular maintenance activity

Popularity49

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~43 days

Total

12

Last Release

120d ago

Major Versions

v1.6 → v2.02026-01-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/9eaf28cb5d9d5d87660cbe335e7b82a08bc7801a40556c3a99740e22282d9e17?d=identicon)[devrabiul](/maintainers/devrabiul)

---

Top Contributors

[![devrabiul](https://avatars.githubusercontent.com/u/112581088?v=4)](https://github.com/devrabiul "devrabiul (64 commits)")[![rabiul6am](https://avatars.githubusercontent.com/u/128285760?v=4)](https://github.com/rabiul6am "rabiul6am (34 commits)")

---

Tags

laravel-toaster-magiclivewirelivewire-toastertoaster-magictoaster-magic-prophplaravelnotificationslivewiretoastrmagicflash-notificationstoasterdynamic-notificationslaravel-toastrlivewire-toaster

### Embed Badge

![Health badge](/badges/devrabiul-laravel-toaster-magic/health.svg)

```
[![Health](https://phpackages.com/badges/devrabiul-laravel-toaster-magic/health.svg)](https://phpackages.com/packages/devrabiul-laravel-toaster-magic)
```

###  Alternatives

[mediconesystems/livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS

1.2k711.3k8](/packages/mediconesystems-livewire-datatables)[php-flasher/flasher-toastr-laravel

Leverage Toastr for stylish toast notifications in Laravel with PHPFlasher. Add Toastr's sleek notifications to your Laravel projects effortlessly.

31586.1k5](/packages/php-flasher-flasher-toastr-laravel)[ascsoftw/livewire-toast

Livewire Package to display Toast Notifications

48544.2k1](/packages/ascsoftw-livewire-toast)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
