PHPackages                             khauto/sessionflashtoster - 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. khauto/sessionflashtoster

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

khauto/sessionflashtoster
=========================

Laravel package for automatic toast notifications from session flash data

v1.0.2(7mo ago)02MITPHP

Since Oct 12Pushed 7mo agoCompare

[ Source](https://github.com/mdkhasib/khauto-session-flash-toster)[ Packagist](https://packagist.org/packages/khauto/sessionflashtoster)[ RSS](/packages/khauto-sessionflashtoster/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

🚀 Laravel Session Flash Toaster
===============================

[](#-laravel-session-flash-toaster)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6e6b88fa4311ec3bfa03e9944d17e5d3d4ded7f1b19751b3f2c0575053f320c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b686175746f2f73657373696f6e666c617368746f737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/khauto/sessionflashtoster)[![Total Downloads](https://camo.githubusercontent.com/a31f6064956fa4076dca844e1fa0a331973b2fe5adb7be3a8c58b405796cd4df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b686175746f2f73657373696f6e666c617368746f737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/khauto/sessionflashtoster)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

A lightweight **Laravel package** that automatically displays beautiful **Toastr.js notifications** for your Laravel session flash messages — no extra setup required.

---

🧩 Features
----------

[](#-features)

✅ Automatically detects session messages (`success`, `error`, `warning`, `info`)
✅ Works out-of-the-box — just install it
✅ Uses **Toastr.js** for modern toast notifications
✅ Fully customizable (position, timeout, progress bar, etc.)
✅ Publishable config and Blade view files
✅ Compatible with **Laravel 10 &amp; 11**

---

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

[](#-installation)

Install via Composer:

```
composer require khauto/sessionflashtoster
```

Laravel will auto-discover the service provider.

---

⚙️ Configuration (optional)
---------------------------

[](#️-configuration-optional)

If you want to customize the Toastr settings, publish the config file:

```
php artisan vendor:publish --tag=sessionflashtoster-config
```

This will create:

```
config/sessionflashtoster.php

```

### Example config:

[](#example-config)

```
return [
    'position'    => 'toast-top-right',
    'timeout'     => 4000,
    'progressBar' => true,
];
```

---

🧱 Usage
-------

[](#-usage)

Once installed, the package automatically shares your session flash messages with all Blade views.

Simply include the toaster script in your main layout (e.g. `resources/views/layouts/app.blade.php`):

```

    My Laravel App

    @yield('content')

    {{-- Include the toaster script --}}
    @include('toaster::scripts')

```

---

### 🔥 Trigger Notifications

[](#-trigger-notifications)

Flash session messages from your controllers, routes, or Livewire components:

```
// In a controller
return redirect()->back()->with('success', 'Profile updated successfully!');
```

### Supported Session Keys

[](#supported-session-keys)

TypeExample Code✅ Success`session()->flash('success', 'Action successful!');`❌ Error`session()->flash('error', 'Something went wrong.');`⚠️ Warning`session()->flash('warning', 'Be careful!');`ℹ️ Info`session()->flash('info', 'Heads up!');`The corresponding Toastr notification will automatically appear on the next page load.

---

🧪 Quick Demo (optional)
-----------------------

[](#-quick-demo-optional)

Add these routes in `routes/web.php` to test notifications:

```
Route::get('/test-toaster', function () {
    return view('test-toaster');
});

Route::get('/notify/{type}', function ($type) {
    return redirect('/test-toaster')->with($type, ucfirst($type) . ' notification triggered!');
});
```

Then create the test view:

```
Session Flash Toaster Test

Success |
Error |
Info |
Warning

@include('sessionflashtoster::scripts')
```

---

🎨 Example Toasts
----------------

[](#-example-toasts)

- ✅ **Success** → Green toast for success actions
- ❌ **Error** → Red toast for errors
- ⚠️ **Warning** → Orange toast for caution
- ℹ️ **Info** → Blue toast for information

All triggered automatically by Laravel’s session flash messages.

---

⚡ Advanced Customization
------------------------

[](#-advanced-customization)

Publish the Blade view if you want to customize Toastr assets or message rendering:

```
php artisan vendor:publish --tag=sessionflashtoster-views
```

This will create:

```
resources/views/vendor/sessionflashtoster/scripts.blade.php

```

You can modify it freely.

---

🧰 Requirements
--------------

[](#-requirements)

- PHP ≥ 8.1
- Laravel 10 or 11

---

🪪 License
---------

[](#-license)

This package is open-sourced under the [MIT license](LICENSE).

---

👨‍💻 Developer
-------------

[](#‍-developer)

Developed with ❤️ by **Md Khairul Hasib**
📧 Email: \[\]
🌐 GitHub:

---

⭐ Support
---------

[](#-support)

If you like this package, please give it a ⭐ on [GitHub](https://github.com/mdkhasib/khauto/sessionflashtoster)!
Your support motivates continued development. 🙏

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance64

Regular maintenance activity

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

218d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a95b4f9ec862284a8939a4d66307cb674eb22271d31eae137110e13605ab4def?d=identicon)[mdkhasib](/maintainers/mdkhasib)

### Embed Badge

![Health badge](/badges/khauto-sessionflashtoster/health.svg)

```
[![Health](https://phpackages.com/badges/khauto-sessionflashtoster/health.svg)](https://phpackages.com/packages/khauto-sessionflashtoster)
```

###  Alternatives

[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[eduardokum/laravel-mail-auto-embed

Library for embed images in emails automatically

1702.0M5](/packages/eduardokum-laravel-mail-auto-embed)

PHPackages © 2026

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