Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Flasher Toastr Laravel Laravel Package

php-flasher/flasher-toastr-laravel

Laravel integration for php-flasher Toastr notifications. Quickly flash success, error, info, and warning messages to the browser using the Toastr JavaScript library, with simple configuration and support for Laravel’s session-based flashing.

View on GitHub
Deep Wiki
Context7

PHPFlasher Toastr - Laravel Adapter

Latest Version Total Downloads License

Laravel adapter for PHPFlasher Toastr. Seamlessly integrate Toastr notifications into Laravel applications.

Requirements

  • PHP >= 8.2
  • Laravel >= 11.0
  • php-flasher/flasher-laravel ^2.4.0
  • php-flasher/flasher-toastr ^2.4.0

Installation

composer require php-flasher/flasher-toastr-laravel

Quick Start

// Global helper
toastr()->success('Operation completed successfully!');
toastr()->error('An error occurred.');
toastr()->info('Information message.');
toastr()->warning('Warning message.');

// In controller
public function save(Request $request)
{
    // Your logic...

    toastr()->success('Changes saved!');

    return redirect()->back();
}

// With options
toastr()->success('Success message', [
    'timeOut' => 5000,
    'positionClass' => 'toast-top-right',
]);

Features

  • Laravel Facade: toastr() global helper
  • Dependency Injection: ToastrFactory type-hinted injection
  • Laravel Integration: Auto-injects assets in Blade templates
  • Flash Bag: Converts Laravel flash messages to Toastr notifications

Configuration

Publish configuration:

php artisan flasher:install --config

Add to config/flasher.php:

return [
    'plugins' => [
        'toastr' => [
            'options' => [
                'timeOut' => 5000,
                'progressBar' => true,
                'positionClass' => 'toast-top-right',
            ],
        ],
    ],
];

Documentation

Complete documentation: php-flasher.io

License

MIT

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope