LaravelPackages.net
Acme Inc.
Toggle sidebar
php-flasher/flasher-toastr-symfony

Integrate Toastr's smooth toast notifications into Symfony projects using PHPFlasher. Enhance Symfony applications with Toastr's refined visuals.

408.711
6
v2.6.1
About php-flasher/flasher-toastr-symfony

php-flasher/flasher-toastr-symfony is a Laravel package for integrate toastr's smooth toast notifications into symfony projects using phpflasher. enhance symfony applications with toastr's refined visuals.. It currently has 6 GitHub stars and 408.711 downloads on Packagist (latest version v2.6.1). Install it with composer require php-flasher/flasher-toastr-symfony. Discover more Laravel packages by php-flasher or browse all Laravel packages to compare alternatives.

Last updated

PHPFlasher Toastr - Symfony Adapter

Latest Version Total Downloads License

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

Requirements

  • PHP >= 8.2
  • Symfony >= 7.0
  • php-flasher/flasher-symfony ^2.4.0
  • php-flasher/flasher-toastr ^2.4.0

Installation

composer require php-flasher/flasher-toastr-symfony

Quick Start

// Global helper
toastr('Your changes have been saved!');

// In controller
public function save(): RedirectResponse
{
    // Your logic...

    toastr('Operation completed successfully!');

    return $this->redirectToRoute('home');
}

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

Features

  • Symfony Helper: toastr() global function
  • Service Injection: ToastrFactory autowired in constructors
  • Twig Integration: Auto-injects assets in Twig templates
  • Flash Bag: Converts Symfony flash messages to Toastr notifications

Configuration

Publish configuration:

php bin/console flasher:install --config

Add to config/packages/flasher.yaml:

flasher:
    toastr:
        options:
            timeOut: 5000
            progressBar: true
            positionClass: toast-top-right

Documentation

Complete documentation: php-flasher.io

License

MIT

Star History Chart