PHPackages                             juanrube/laravel-toast-magic-8 - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. juanrube/laravel-toast-magic-8

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

juanrube/laravel-toast-magic-8
==============================

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

0.0.3(8mo ago)021MITPHPPHP ^7.3|^8.0

Since Sep 10Pushed 8mo agoCompare

[ Source](https://github.com/juanrube/ToastMagic)[ Packagist](https://packagist.org/packages/juanrube/laravel-toast-magic-8)[ RSS](/packages/juanrube-laravel-toast-magic-8/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

🍞 ToastMagic - Laravel Toaster (With Livewire v3 Support)
=========================================================

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

this is a fork adapted to Laravel8 and PHP &lt; 8
-------------------------------------------------

[](#this-is-a-fork-adapted-to-laravel8-and-php--8)

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, supports custom events, and now features a Material-inspired design for a modern 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)

---

📚 Table of Contents
-------------------

[](#-table-of-contents)

- [🍞 ToastMagic - Laravel Toaster (With Livewire v3 Support)](#-toastmagic---laravel-toaster-with-livewire-v3-support)
    - [this is a fork adapted to Laravel8 and PHP &lt; 8](#this-is-a-fork-adapted-to-laravel8-and-php--8)
    - [📚 Table of Contents](#-table-of-contents)
    - [🚀 Live Demo](#-live-demo)
    - [✨ Features](#-features)
    - [📦 Installation](#-installation)
    - [⚙️ Usage](#%EF%B8%8F-usage)
        - [1. Basic Setup](#1-basic-setup)
        - [2. Usage in Controller](#2-usage-in-controller)
        - [3. Usage in JavaScript (Optional)](#3-usage-in-javascript-optional)
        - [4. ✅ Livewire v3 Support](#4--livewire-v3-support)
        - [5. ✅ Themes](#5--themes)
        - [6. 🎨 Enabling Color Mode](#6--enabling-color-mode)
        - [7. 🎨 Enabling Gradient Mode](#7--enabling-gradient-mode)
    - [🧩 Alternative Syntax &amp; Fluent API](#-alternative-syntax--fluent-api)
        - [🔹 Static Method (Quick)](#-static-method-quick)
        - [🔹 Fluent Syntax (Advanced)](#-fluent-syntax-advanced)
    - [📍 Toast Position Options](#-toast-position-options)
    - [🌙 Enable Dark Mode](#-enable-dark-mode)
    - [🎯 Get Started Today!](#-get-started-today)
    - [🤝 Contributing](#-contributing)
    - [📄 License](#-license)
    - [🌱 Treeware](#-treeware)
    - [📬 Contact](#-contact)

---

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

[](#-live-demo)

👉 [Check out the live demo](https://laravel-toaster-magic.rixetbd.com)

[![Live Demo Thumbnail](https://camo.githubusercontent.com/26a6c7852260757420b2aa93f258a504aaaf0b111f0184da22f62db3e1ba4bfb/68747470733a2f2f6c61726176656c2d746f61737465722d6d616769632e726978657462642e636f6d2f7075626c69632f6173736574732f696d672f7468756d626e61696c2e706e67)](https://camo.githubusercontent.com/26a6c7852260757420b2aa93f258a504aaaf0b111f0184da22f62db3e1ba4bfb/68747470733a2f2f6c61726176656c2d746f61737465722d6d616769632e726978657462642e636f6d2f7075626c69632f6173736574732f696d672f7468756d626e61696c2e706e67)

---

✨ 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.
- 🎨 **Customizable** – Tailor toasts with various styles, buttons, and positions.
- ⚡ **Livewire v3 Ready** – Fully supports Livewire v3 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 v3 Support

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

Enable Livewire support by updating your config file:

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

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

- 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

[](#5--themes)

Change Theme by updating your config file:

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

return [
    'options' => [
        // your toast options..
        "theme" => "material", // "default, material".
    ],
    // your toast options..
];
```

---

### 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, // Only available for default and material themes
    ],
    'livewire_enabled' => false,
    'livewire_version' => 'v3',
];
```

> **Note:** Gradient mode works only with the **default** and **material** 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

28

—

LowBetter than 54% of packages

Maintenance61

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

244d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0503978603e7f72b2ca37cf37abf33368618884e39deecc597ef36497cd07f63?d=identicon)[jrube](/maintainers/jrube)

---

Top Contributors

[![juanrube](https://avatars.githubusercontent.com/u/186569526?v=4)](https://github.com/juanrube "juanrube (3 commits)")

---

Tags

phplaravelnotificationslivewiretoastrmagicflash-notificationstoasterdynamic-notificationslaravel-toastrlivewire-toaster

### Embed Badge

![Health badge](/badges/juanrube-laravel-toast-magic-8/health.svg)

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

###  Alternatives

[devrabiul/laravel-toaster-magic

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

22351.5k1](/packages/devrabiul-laravel-toaster-magic)[brian2694/laravel-toastr

toastr.js for Laravel

136649.4k5](/packages/brian2694-laravel-toastr)[php-flasher/flasher-laravel

Seamlessly integrate flash notifications into your Laravel applications with PHPFlasher. Enhance user feedback and engagement with minimal setup.

442.8M35](/packages/php-flasher-flasher-laravel)[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)[oriceon/toastr-5-laravel

Easy toastr notifications for Laravel 5

92473.5k3](/packages/oriceon-toastr-5-laravel)[helmesvs/laravel-notify

Elegant notifications to laravel with Toastr or PNotify

6127.3k](/packages/helmesvs-laravel-notify)

PHPackages © 2026

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