Fix incorrect code examples in Prime adapter READMEs

- Replace non-existent static method calls with correct helper functions
- Update examples to use sweetalert(), notyf(), noty(), toastr() helpers
- Pass options as arrays instead of invalid fluent chaining
This commit is contained in:
Younes ENNAJI
2026-01-10 04:19:17 +01:00
parent 0232edc9bd
commit 5a4d46b46b
4 changed files with 67 additions and 65 deletions
+17 -18
View File
@@ -20,23 +20,21 @@ composer require php-flasher/flasher-noty
## Quick Start ## Quick Start
```php ```php
use Flasher\Noty\Prime\NotyFactory;
// Basic usage // Basic usage
Noty::success('Operation completed successfully!'); noty('Operation completed successfully!', 'success');
Noty::error('An error occurred.'); noty('An error occurred.', 'error');
Noty::info('Information message.'); noty('Information message.', 'info');
Noty::warning('Warning message.'); noty('Warning message.', 'warning');
// With options // With options
Noty::success('Success message', [ noty('Success message', 'success', [
'timeout' => 3000, 'timeout' => 3000,
'layout' => 'topCenter', 'layout' => 'topCenter',
'progressBar' => true, 'progressBar' => true,
]); ]);
// Custom notification // Custom notification
Noty::flash('custom-type', 'Custom message'); noty('Custom message', 'custom-type');
``` ```
## Features ## Features
@@ -51,25 +49,26 @@ Noty::flash('custom-type', 'Custom message');
```php ```php
// Success notification // Success notification
Noty::success($message, $title, $options); noty($message, 'success', $options, $title);
// Error notification // Error notification
Noty::error($message, $title, $options); noty($message, 'error', $options, $title);
// Info notification // Info notification
Noty::info($message, $title, $options); noty($message, 'info', $options, $title);
// Warning notification // Warning notification
Noty::warning($message, $title, $options); noty($message, 'warning', $options, $title);
// Custom notification type // Custom notification type
Noty::flash($type, $message, $title, $options); noty($message, $type, $options, $title);
// Set options // With options
Noty::success($message) noty($message, 'success', [
->layout('topCenter') 'layout' => 'topCenter',
->timeout(3000) 'timeout' => 3000,
->theme('mint'); 'theme' => 'mint',
], $title);
``` ```
## Documentation ## Documentation
+23 -18
View File
@@ -20,22 +20,23 @@ composer require php-flasher/flasher-notyf
## Quick Start ## Quick Start
```php ```php
use Flasher\Notyf\Prime\NotyfFactory;
// Basic usage // Basic usage
Notyf::success('Operation completed successfully!'); notyf('Operation completed successfully!', 'success');
Notyf::error('An error occurred.'); notyf('An error occurred.', 'error');
Notyf::info('Information message.'); notyf('Information message.', 'info');
Notyf::warning('Warning message.'); notyf('Warning message.', 'warning');
// With options // With options
Notyf::success('Success message', [ notyf('Success message', 'success', [
'duration' => 4000, 'duration' => 4000,
'position' => 'top-right', 'position' => [
'x' => 'right',
'y' => 'top',
],
]); ]);
// Custom notification // Custom notification
Notyf::flash('custom-type', 'Custom message'); notyf('Custom message', 'custom-type');
``` ```
## Features ## Features
@@ -50,24 +51,28 @@ Notyf::flash('custom-type', 'Custom message');
```php ```php
// Success notification // Success notification
Notyf::success($message, $title, $options); notyf($message, 'success', $options, $title);
// Error notification // Error notification
Notyf::error($message, $title, $options); notyf($message, 'error', $options, $title);
// Info notification // Info notification
Notyf::info($message, $title, $options); notyf($message, 'info', $options, $title);
// Warning notification // Warning notification
Notyf::warning($message, $title, $options); notyf($message, 'warning', $options, $title);
// Custom notification type // Custom notification type
Notyf::flash($type, $message, $title, $options); notyf($message, $type, $options, $title);
// Set options // With options
Notyf::success($message) notyf($message, 'success', [
->duration(4000) 'duration' => 4000,
->position('top-right'); 'position' => [
'x' => 'right',
'y' => 'top',
],
], $title);
``` ```
## Documentation ## Documentation
+21 -21
View File
@@ -20,25 +20,24 @@ composer require php-flasher/flasher-sweetalert
## Quick Start ## Quick Start
```php ```php
use Flasher\SweetAlert\Prime\SweetAlertFactory;
// Basic usage // Basic usage
SweetAlert::success('Operation completed successfully!'); sweetalert('Operation completed successfully!', 'success');
SweetAlert::error('An error occurred.'); sweetalert('An error occurred.', 'error');
SweetAlert::info('Information message.'); sweetalert('Information message.', 'info');
SweetAlert::warning('Warning message.'); sweetalert('Warning message.', 'warning');
// With options // With options
SweetAlert::success('Success message', [ sweetalert('Success message', 'success', [
'timer' => 3000, 'timer' => 3000,
'toast' => true, 'toast' => true,
'position' => 'top-end', 'position' => 'top-end',
]); ]);
// Modal dialog // Modal dialog with options
SweetAlert::success('Profile updated!') sweetalert('Profile updated!', 'success', [
->confirmButtonText('Great!') 'confirmButtonText' => 'Great!',
->timer(5000); 'timer' => 5000,
]);
``` ```
## Features ## Features
@@ -53,25 +52,26 @@ SweetAlert::success('Profile updated!')
```php ```php
// Success notification // Success notification
SweetAlert::success($message, $title, $options); sweetalert($message, 'success', $options, $title);
// Error notification // Error notification
SweetAlert::error($message, $title, $options); sweetalert($message, 'error', $options, $title);
// Info notification // Info notification
SweetAlert::info($message, $title, $options); sweetalert($message, 'info', $options, $title);
// Warning notification // Warning notification
SweetAlert::warning($message, $title, $options); sweetalert($message, 'warning', $options, $title);
// Custom notification type // Custom notification type
SweetAlert::flash($type, $message, $title, $options); sweetalert($message, $type, $options, $title);
// Set options // With options
SweetAlert::success($message) sweetalert($message, 'success', [
->timer(3000) 'timer' => 3000,
->toast(true) 'toast' => true,
->position('top-end'); 'position' => 'top-end',
], $title);
``` ```
## Documentation ## Documentation
+6 -8
View File
@@ -20,23 +20,21 @@ composer require php-flasher/flasher-toastr
## Quick Start ## Quick Start
```php ```php
use Flasher\Toastr\Prime\ToastrFactory;
// Basic usage // Basic usage
Toastr::success('Operation completed successfully!'); toastr('Operation completed successfully!', 'success');
Toastr::error('An error occurred.'); toastr('An error occurred.', 'error');
Toastr::info('Information message.'); toastr('Information message.', 'info');
Toastr::warning('Warning message.'); toastr('Warning message.', 'warning');
// With options // With options
Toastr::success('Success message', [ toastr('Success message', 'success', [
'timeOut' => 5000, 'timeOut' => 5000,
'positionClass' => 'toast-top-right', 'positionClass' => 'toast-top-right',
'progressBar' => true, 'progressBar' => true,
]); ]);
// Custom notification // Custom notification
Toastr::flash('custom-type', 'Custom message'); toastr('Custom message', 'custom-type');
``` ```
## Features ## Features