PHPackages                             thbappy7706/laravel-toastify - 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. thbappy7706/laravel-toastify

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

thbappy7706/laravel-toastify
============================

A beautiful, customizable toast notification package for Laravel Blade and Livewire v3/v4 with bouncing animations inspired by react-toastify

v1.1.3(4mo ago)01MITCSSPHP ^8.1|^8.2|^8.3|^8.4CI passing

Since Feb 15Pushed 4mo agoCompare

[ Source](https://github.com/thbappy7706/laravel-toastify)[ Packagist](https://packagist.org/packages/thbappy7706/laravel-toastify)[ Docs](https://github.com/thbappy7706/laravel-toastify)[ RSS](/packages/thbappy7706-laravel-toastify/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

Laravel Toastify
================

[](#laravel-toastify)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8080ca3e9138cedea446a88f8db86df576a7468162154e73474622cbbdc23801/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74686261707079373730362f6c61726176656c2d746f6173746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thbappy7706/laravel-toastify)[![Total Downloads](https://camo.githubusercontent.com/d8fca3a2b794904d580b736b2b9a167f6dba9531cd99afd716d19dc6eaaf584d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74686261707079373730362f6c61726176656c2d746f6173746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thbappy7706/laravel-toastify)[![License](https://camo.githubusercontent.com/db29c0ae71ded2ae0f4489bddb015662a48f9d0f831b148b4b15ab2b4f382730/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74686261707079373730362f6c61726176656c2d746f6173746966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thbappy7706/laravel-toastify)

A feature-rich, customizable toast notification package for Laravel Blade and Livewire v3/v4, inspired by react-toastify. Includes beautiful bouncing animations and extensive customization options.

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

[](#-live-demo)

👉 [View Live Demo](https://thbappy7706.github.io/laravel-toastify/demo.html)

Features
--------

[](#features)

✨ **Multiple Animations**: Bounce (default), Slide, Zoom, Flip
🎯 **Flexible Positioning**: 6 positions (top-left, top-right, top-center, bottom-left, bottom-right, bottom-center)
🎨 **Toast Types**: Success, Error, Warning, Info, Default
⏱️ **Auto-close**: Customizable duration or disable
📊 **Progress Bar**: Visual countdown timer
🖱️ **Drag to Dismiss**: Swipe or drag toasts away
⏸️ **Pause on Hover**: Auto-pause timer when hovering
🌙 **Multiple Themes**: Light, Dark, Colored
🌍 **RTL Support**: Right-to-left text direction
📱 **Responsive**: Mobile-friendly
⚡ **Livewire v3/v4 Compatible**: Real-time updates 🎭 **Stackable**: Multiple toasts display beautifully

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10.x, 11.x, or 12.x
- Livewire 3.x or 4.x

Installation
------------

[](#installation)

1. Install via Composer:

```
composer require thbappy7706/laravel-toastify
```

2. Publish the config, views, and assets:

```
php artisan vendor:publish --tag=toastify-config
php artisan vendor:publish --tag=toastify-views
php artisan vendor:publish --tag=toastify-assets
```

Setup
-----

[](#setup)

### For Livewire Applications

[](#for-livewire-applications)

Add the Livewire component to your layout file (usually `resources/views/layouts/app.blade.php`):

```

    @stack('styles')

    {{ $slot }}

    @stack('scripts')

```

### For Traditional Blade Applications

[](#for-traditional-blade-applications)

Use the Blade directive in your layout:

```

    @stack('styles')

    @yield('content')

    @toastify

    @stack('scripts')

```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

#### In Controllers (Redirects)

[](#in-controllers-redirects)

```
use Toastify\Laravel\Facades\Toastify;

public function store(Request $request)
{
    // Your logic here

    Toastify::success('User created successfully!');

    return redirect()->route('users.index');
}

// Other types
Toastify::error('Something went wrong!');
Toastify::warning('Please check your input!');
Toastify::info('New update available!');
Toastify::default('This is a toast message');
```

#### In Livewire Components

[](#in-livewire-components)

```
use Toastify\Laravel\Facades\Toastify;

class UserForm extends Component
{
    public function save()
    {
        // Your logic here

        $this->dispatch('toast:add', toast: [
            'type' => 'success',
            'message' => 'Data saved successfully!'
        ]);
    }
}
```

#### In JavaScript (Frontend)

[](#in-javascript-frontend)

```
// Success toast
window.toastify.success('Operation successful!');

// Error toast
window.toastify.error('Operation failed!');

// Warning toast
window.toastify.warning('Please be careful!');

// Info toast
window.toastify.info('Did you know?');

// Default toast
window.toastify.default('Hello World!');
```

### Advanced Usage

[](#advanced-usage)

#### Custom Options

[](#custom-options)

```
Toastify::success('Custom toast!', [
    'autoClose' => 3000,           // Auto close after 3 seconds
    'position' => 'bottom-right',   // Position
    'transition' => 'slide',        // Animation type
    'hideProgressBar' => false,     // Show progress bar
    'pauseOnHover' => true,         // Pause on hover
    'draggable' => true,            // Enable drag to dismiss
    'closeButton' => true,          // Show close button
    'rtl' => false,                 // Right-to-left
]);
```

#### Available Options

[](#available-options)

OptionTypeDefaultDescription`autoClose`int/false5000Auto close duration in ms (false to disable)`position`string'top-right'Position of toast`transition`string'bounce'Animation type (bounce, slide, zoom, flip)`hideProgressBar`boolfalseHide the progress bar`closeButton`booltrueShow close button`pauseOnHover`booltruePause timer on hover`pauseOnFocusLoss`booltruePause when window loses focus`draggable`booltrueEnable drag to dismiss`draggablePercent`int80Percentage of width to dismiss`rtl`boolfalseRight-to-left direction#### Available Positions

[](#available-positions)

- `top-left`
- `top-center`
- `top-right`
- `bottom-left`
- `bottom-center`
- `bottom-right`

#### Available Transitions

[](#available-transitions)

- `bounce` - Bouncing effect (default)
- `slide` - Sliding effect
- `zoom` - Zoom in/out effect
- `flip` - Flipping effect

#### Available Toast Types

[](#available-toast-types)

- `success` - Green toast with checkmark icon
- `error` - Red toast with error icon
- `warning` - Yellow toast with warning icon
- `info` - Blue toast with info icon
- `default` - White toast without icon

### Container Customization

[](#container-customization)

You can customize the container globally:

```

```

### Programmatic Control

[](#programmatic-control)

#### Remove Specific Toast

[](#remove-specific-toast)

```
// From JavaScript
window.Livewire.dispatch('toast:remove', { id: 'toast_id_here' });
```

#### Clear All Toasts

[](#clear-all-toasts)

```
// From JavaScript
window.Livewire.dispatch('toast:clear');
```

```
// From PHP
Toastify::clear();
```

Configuration
-------------

[](#configuration)

The configuration file is located at `config/toastify.php`:

```
return [
    'position' => env('TOASTIFY_POSITION', 'top-right'),
    'transition' => env('TOASTIFY_TRANSITION', 'bounce'),
    'autoClose' => env('TOASTIFY_AUTO_CLOSE', 5000),
    'hideProgressBar' => env('TOASTIFY_HIDE_PROGRESS_BAR', false),
    'closeButton' => env('TOASTIFY_CLOSE_BUTTON', true),
    'pauseOnHover' => env('TOASTIFY_PAUSE_ON_HOVER', true),
    'pauseOnFocusLoss' => env('TOASTIFY_PAUSE_ON_FOCUS_LOSS', true),
    'draggable' => env('TOASTIFY_DRAGGABLE', true),
    'draggablePercent' => env('TOASTIFY_DRAGGABLE_PERCENT', 80),
    'rtl' => env('TOASTIFY_RTL', false),
    'newestOnTop' => env('TOASTIFY_NEWEST_ON_TOP', true),
    'theme' => env('TOASTIFY_THEME', 'light'),
];
```

### Environment Variables

[](#environment-variables)

You can set defaults in your `.env` file:

```
TOASTIFY_POSITION=top-right
TOASTIFY_TRANSITION=bounce
TOASTIFY_AUTO_CLOSE=5000
TOASTIFY_THEME=light
TOASTIFY_DRAGGABLE=true
```

Styling &amp; Theming
---------------------

[](#styling--theming)

### Themes

[](#themes)

Available themes:

- `light` - Light background (default)
- `dark` - Dark background
- `colored` - Background matches toast type color

Change theme in config:

```
'theme' => 'dark',
```

### Custom Styling

[](#custom-styling)

You can customize the CSS by editing the published CSS file at `public/vendor/toastify/css/toastify.css` or by overriding CSS variables:

```
:root {
    --toastify-color-success: #10b981;
    --toastify-color-error: #ef4444;
    --toastify-color-warning: #f59e0b;
    --toastify-color-info: #3b82f6;
    --toastify-toast-width: 350px;
    --toastify-z-index: 9999;
}
```

Examples
--------

[](#examples)

### Success Notification

[](#success-notification)

```
Toastify::success('Profile updated successfully!');
```

### Error with Custom Duration

[](#error-with-custom-duration)

```
Toastify::error('Failed to save data!', [
    'autoClose' => 8000, // 8 seconds
]);
```

### Warning at Bottom

[](#warning-at-bottom)

```
Toastify::warning('Your session will expire soon!', [
    'position' => 'bottom-center',
    'autoClose' => false, // Don't auto close
]);
```

### Info with Slide Animation

[](#info-with-slide-animation)

```
Toastify::info('Check out our new features!', [
    'transition' => 'slide',
    'position' => 'top-left',
]);
```

### Multiple Toasts

[](#multiple-toasts)

```
Toastify::success('Item 1 added!');
Toastify::success('Item 2 added!');
Toastify::info('Cart updated!');
```

### RTL Support

[](#rtl-support)

```
Toastify::success('تم الحفظ بنجاح!', [
    'rtl' => true,
]);
```

Browser Support
---------------

[](#browser-support)

- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)

Credits
-------

[](#credits)

Inspired by [react-toastify](https://github.com/fkhadra/react-toastify) by Fadi Khadra.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Support
-------

[](#support)

If you encounter any issues or have questions, please file an issue on the GitHub repository.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance75

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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

5

Last Release

138d ago

PHP version history (2 changes)v1.0.0PHP ^8.1|^8.2|^8.3

v1.1.3PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d7b86a335fd7f9c38167079c3c9added0d159a736cf322d2fe9039f86d9d324?d=identicon)[thbappy](/maintainers/thbappy)

---

Top Contributors

[![thbappy7706](https://avatars.githubusercontent.com/u/26590361?v=4)](https://github.com/thbappy7706 "thbappy7706 (7 commits)")

---

Tags

laravelnotificationslivewirealertsflash-messagestoastlaravel-notificationstoast-notificationstoastifylivewire-v4bounce-animationlivewire-v3

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thbappy7706-laravel-toastify/health.svg)

```
[![Health](https://phpackages.com/badges/thbappy7706-laravel-toastify/health.svg)](https://phpackages.com/packages/thbappy7706-laravel-toastify)
```

###  Alternatives

[livewire/flux

The official UI component library for Livewire.

9527.8M128](/packages/livewire-flux)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725172.4k14](/packages/tallstackui-tallstackui)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)[mati365/ckeditor5-livewire

CKEditor 5 integration for Laravel Livewire

447.9k](/packages/mati365-ckeditor5-livewire)

PHPackages © 2026

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