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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4