mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
Fix incorrect examples in src/Prime/README.md
- Replace non-existent static Flasher:: calls with flash() helper function
This commit is contained in:
+4
-6
@@ -19,22 +19,20 @@ composer require php-flasher/flasher
|
|||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use Flasher\Prime\Flasher;
|
|
||||||
|
|
||||||
// Success notification
|
// Success notification
|
||||||
Flasher::success('Operation completed successfully!');
|
flash('Operation completed successfully!', 'success');
|
||||||
|
|
||||||
// Error notification
|
// Error notification
|
||||||
Flasher::error('An error occurred.');
|
flash('An error occurred.', 'error');
|
||||||
|
|
||||||
// With options
|
// With options
|
||||||
Flasher::success('Profile updated!', [
|
flash('Profile updated!', 'success', [
|
||||||
'timeout' => 5000,
|
'timeout' => 5000,
|
||||||
'position' => 'top-right',
|
'position' => 'top-right',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// With translation
|
// With translation
|
||||||
Flasher::info('Welcome back!', [
|
flash('Welcome back!', 'info', [
|
||||||
'translate' => true,
|
'translate' => true,
|
||||||
'locale' => 'en',
|
'locale' => 'en',
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user