mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
d7234c64a2
Remove descriptive class/interface-level documentation that duplicates what the class/interface names already convey, while keeping all type annotations (@param, @return, @var, @throws, @phpstan-, @mixin, @template, @internal). Files modified: - Symfony integration (18 files): Attribute, Translation, Template, Component, Storage, Support, Http, Profiler, Command, Twig, EventListener, FlasherSymfonyBundle - Laravel integration (13 files): ServiceProvider, Storage, Middleware, Http, Facade, Template, Translation, Command, Component, EventListener - Prime/EventDispatcher (17 files): Events and EventListeners - Prime/Storage (11 files): Filter/Criteria and Bag interfaces - Prime/Stamp (4 files): Interface and stamp classes - Prime/Factory (5 files): Factory interfaces and implementations - Prime/Notification (2 files): Envelope and Notification - Prime/Support/Traits (1 file): ForwardsCalls
PHPFlasher Laravel Adapter
Laravel framework adapter for PHPFlasher. Seamless integration with zero JavaScript setup.
Requirements
- PHP >= 8.2
- Laravel >= 11.0
Installation
composer require php-flasher/flasher-laravel
Run the install command:
php artisan flasher:install
Quick Start
// Success notification
flash()->success('Operation completed successfully!');
// Error notification
flash()->error('An error occurred.');
// With options
flash()->success('Profile updated!', [
'timeout' => 5000,
'position' => 'top-right',
]);
// In controller
public function update(Request $request)
{
// Your logic...
flash()->success('Changes saved!');
return redirect()->back();
}
Configuration
Publish configuration file:
php artisan flasher:install --config
This creates config/flasher.php where you can customize:
- Default adapter
- Global options
- Flash bag mapping
- Presets
Documentation
Complete documentation: php-flasher.io