Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Laravel Toaster Magic

Laravel Toaster Magic stats

Downloads
1.2K
Stars
141
Open Issues
0
Forks
9

View on GitHub →

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

ToastMagic - Laravel Toaster

A powerful and flexible Toaster package for Laravel applications, designed to enhance user experience with customizable toast notifications.

Live Demo

👉 Check out the live demo

Features

  • 🔥 Easy-to-Use Toaster Package – Simple and intuitive toast notificaiton for Laravel.
  • 🌍 RTL Support – Fully compatible with right-to-left (RTL) languages.
  • 🌙 Dark Mode Support – Seamless dark mode for a better user experience.
  • 📦 Customizable Notifications – Tailor toast messages to fit your application's needs.

Installation

To get started with ToastMagic, follow these simple steps:

  1. Install the package via Composer:

    composer require devrabiul/laravel-toaster-magic
  2. Publish the package resources by running:

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

Usage

1. Basic Setup

Integrate ToastMagic into your Blade template by adding the following includes:

  1. Add the styles in your <head> section:

    {!! ToastMagic::styles() !!}
  2. Add the scripts before the closing <body> tag:

    {!! ToastMagic::scripts() !!}
  3. Example:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Page</title>
     
    {!! ToastMagic::styles() !!}
    </head>
    <body>
    // Your Content
     
    {!! ToastMagic::scripts() !!}
    </body>
    </html>

2. Usage in Controller

You can trigger toast notifications from your Laravel controller using the ToastMagic facade.

use Devrabiul\ToastMagic\Facades\ToastMagic;
 
class LanguageController extends Controller
{
public function add()
{
// Your logic
ToastMagic::success('Successfully Updated');
return back();
}
}

3. Usage in JavaScript (Optional - For AJAX calls)

const toastMagic = new ToastMagic();
 
// Show a success toast
toastMagic.success("Success!", "Your data has been saved!");
 
// Show an error toast
toastMagic.error("Error!", "Something went wrong.");
 
// Show a warning toast with a close button
toastMagic.warning("Warning!", "Please check your input.", true);
 
// Show an info toast with a custom button
toastMagic.info("Info!", "Click below for more details.", false, "Learn More", "https://example.com");

Toast Position Options

You can configure the position of the toast notifications using the following options:

Position Description
toast-top-start Displays toast in the top left corner.
toast-top-end Displays toast in the top right corner.
toast-bottom-start Displays toast in the bottom left corner.
toast-bottom-end Displays toast in the bottom right corner.
toast-top-center Displays toast at the top center.
toast-bottom-center Displays toast at the bottom center.

🎯 Get Started Today!

Experience the magic of ToastMagic and enhance your Laravel applications with elegant toast notifications.

🔗 GitHub: Laravel Toaster Magic
🔗 Website: laravel-toaster-magic.rixetbd.com
🔗 Packagist: https://packagist.org/packages/devrabiul/laravel-toaster-magic

Contributing

We welcome contributions to ToastMagic! If you would like to contribute, please fork the repository and submit a pull request. For any issues or feature requests, please open an issue on GitHub.

License

This package is open-sourced software licensed under the MIT license.

Contact

For support or inquiries, please reach out to us at Send Mail.

devrabiul photo

I am a passionate Software Engineer creating high-quality, error-free websites. I specialize in clean code, performance, security, and user-friendly experiences

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Devrabiul Laravel Toaster Magic Related Articles

Laravel Toaster Magic image

Laravel Toaster Magic

Read article
The Certification of Competence for Laravel logo

The Certification of Competence for Laravel

A community-driven, proctored assessment across 4 levels designed to validate real-world Laravel knowledge, from Junior to mastery-level Artisan. Official Vue.js, Official Nuxt, Angular, React, JS certifications also available.

The Certification of Competence for Laravel
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum