Adds documentation files and improves package READMEs

This commit is contained in:
Younes ENNAJI
2026-01-10 03:54:56 +01:00
parent 1c5fbbba9a
commit 0232edc9bd
13 changed files with 597 additions and 1163 deletions
+40 -383
View File
@@ -1,415 +1,72 @@
<div align="center"> # PHPFlasher Laravel Adapter
<a href="https://github.com/php-flasher/php-flasher/blob/2.x/docs/palestine.md">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/palestine-banner-support.svg" width="800px" alt="Help Palestine"/>
</a>
</div>
<p align="center"> [![Latest Version](https://img.shields.io/packagist/v/php-flasher/flasher-laravel.svg)](https://packagist.org/packages/php-flasher/flasher-laravel)
<picture> [![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-laravel.svg)](https://packagist.org/packages/php-flasher/flasher-laravel)
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo-dark.png"> [![License](https://img.shields.io/packagist/l/php-flasher/flasher-laravel.svg)](https://packagist.org/packages/php-flasher/flasher-laravel)
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo.png" alt="PHPFlasher Logo">
</picture>
</p>
<p align="center"> Laravel framework adapter for PHPFlasher. Seamless integration with zero JavaScript setup.
<a href="https://www.linkedin.com/in/younes--ennaji"><img src="https://img.shields.io/badge/author-@yoeunes-blue.svg" alt="Author Badge"></a>
<a href="https://github.com/php-flasher/php-flasher"><img src="https://img.shields.io/badge/source-php--flasher/php--flasher-blue.svg" alt="Source Code Badge"></a>
<a href="https://github.com/php-flasher/php-flasher/releases"><img src="https://img.shields.io/github/tag/php-flasher/flasher.svg" alt="GitHub Release Badge"></a>
<a href="https://github.com/php-flasher/flasher/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="License Badge"></a>
<a href="https://packagist.org/packages/php-flasher/flasher"><img src="https://img.shields.io/packagist/dt/php-flasher/flasher.svg" alt="Packagist Downloads Badge"></a>
<a href="https://github.com/php-flasher/php-flasher"><img src="https://img.shields.io/github/stars/php-flasher/php-flasher.svg" alt="GitHub Stars Badge"></a>
<a href="https://packagist.org/packages/php-flasher/flasher"><img src="https://img.shields.io/packagist/php-v/php-flasher/flasher.svg" alt="Supported PHP Version Badge"></a>
</p>
## Table of Contents ## Requirements
- [About PHPFlasher Laravel Adapter](#about-phpflasher-laravel-adapter) - PHP >= 8.2
- [Features](#features) - Laravel >= 11.0
- [Supported Versions](#supported-versions)
- [Installation](#installation)
- [Core Package](#core-package)
- [Adapters](#adapters)
- [Configuration](#configuration)
- [Configuration File](#configuration-file)
- [Configuration Options](#configuration-options)
- [Quick Start](#quick-start)
- [Usage Examples](#usage-examples)
- [Adapters Overview](#adapters-overview)
- [Official Documentation](#official-documentation)
- [Contributors and Sponsors](#contributors-and-sponsors)
- [Contact](#contact)
- [License](#license)
## About PHPFlasher Laravel Adapter
**PHPFlasher Laravel Adapter** is an open-source package that seamlessly integrates PHPFlasher's powerful flash messaging capabilities into your **Laravel** applications. It simplifies the process of adding flash messages, providing an intuitive API to enhance user experience with minimal setup.
With PHPFlasher Laravel Adapter, you can effortlessly display success, error, warning, and informational messages to your users, ensuring clear communication of application states and actions.
## Features
- **Seamless Laravel Integration**: Designed specifically for Laravel, ensuring compatibility and ease of use.
- **Multiple Notification Libraries**: Supports various frontend libraries like Toastr, Noty, SweetAlert, and Notyf.
- **Flexible Configuration**: Customize the appearance and behavior of flash messages to fit your application's needs.
- **Intuitive API**: Simple methods to create and manage flash messages without boilerplate code.
- **Extensible**: Easily add or create new adapters for different frontend libraries.
## Supported Versions
| PHPFlasher Laravel Adapter Version | PHP Version | Laravel Version |
|------------------------------------|-------------|-----------------|
| **v2.x** | ≥ 8.2 | ≥ 11 |
| **v1.x** | ≥ 5.3 | ≥ 4.0 |
> **Note:** Ensure your project meets the PHP and Laravel version requirements for the PHPFlasher Laravel Adapter version you intend to use. For older PHP or Laravel versions, refer to [PHPFlasher v1.x](https://github.com/php-flasher/flasher-laravel/tree/1.x).
## Installation ## Installation
### Core Package
Install the PHPFlasher Laravel Adapter via Composer:
```bash ```bash
composer require php-flasher/flasher-laravel composer require php-flasher/flasher-laravel
``` ```
After installation, set up the necessary assets: Run the install command:
```shell ```bash
php artisan flasher:install php artisan flasher:install
``` ```
> **Note:** PHPFlasher automatically injects the necessary JavaScript and CSS assets into your Blade templates. No additional steps are required for asset injection. ## Quick Start
### Adapters ```php
// Success notification
flash()->success('Operation completed successfully!');
PHPFlasher provides various adapters for different notification libraries. Below is an overview of available adapters for Laravel: // Error notification
flash()->error('An error occurred.');
- [flasher-toastr-laravel](https://github.com/php-flasher/flasher-toastr-laravel) - Laravel Adapter // With options
- [flasher-noty-laravel](https://github.com/php-flasher/flasher-noty-laravel) - Laravel Adapter flash()->success('Profile updated!', [
- [flasher-notyf-laravel](https://github.com/php-flasher/flasher-notyf-laravel) - Laravel Adapter 'timeout' => 5000,
- [flasher-sweetalert-laravel](https://github.com/php-flasher/flasher-sweetalert-laravel) - Laravel Adapter 'position' => 'top-right',
]);
For detailed installation and usage instructions for each adapter, refer to their respective `README.md`. // In controller
public function update(Request $request)
{
// Your logic...
flash()->success('Changes saved!');
return redirect()->back();
}
```
## Configuration ## Configuration
After installing the PHPFlasher Laravel Adapter, you can configure it by publishing the configuration file or by modifying it directly. Publish configuration file:
### Configuration File
If you need to customize the default settings, publish the configuration file using the following command:
```bash ```bash
php artisan flasher:install --config php artisan flasher:install --config
``` ```
This will create a file at `config/flasher.php` with the following content: This creates `config/flasher.php` where you can customize:
- Default adapter
- Global options
- Flash bag mapping
- Presets
```php ## Documentation
<?php
declare(strict_types=1); Complete documentation: [php-flasher.io](https://php-flasher.io)
use Flasher\Prime\Configuration;
return Configuration::from([
// Default notification library (e.g., 'flasher', 'toastr', 'noty', 'notyf', 'sweetalert')
'default' => 'flasher',
// Path to the main PHPFlasher JavaScript file
'main_script' => '/vendor/flasher/flasher.min.js',
// List of CSS files to style your notifications
'styles' => [
'/vendor/flasher/flasher.min.css',
],
// Set global options for all notifications (optional)
// 'options' => [
// 'timeout' => 5000, // Time in milliseconds before the notification disappears
// 'position' => 'top-right', // Where the notification appears on the screen
// ],
// Automatically inject JavaScript and CSS assets into your HTML pages
'inject_assets' => true,
// Enable message translation using Laravel's translation service
'translate' => true,
// URL patterns to exclude from asset injection and flash_bag conversion
'excluded_paths' => [],
// Map Laravel flash message keys to notification types
'flash_bag' => [
'success' => ['success'],
'error' => ['error', 'danger'],
'warning' => ['warning', 'alarm'],
'info' => ['info', 'notice', 'alert'],
],
// Set criteria to filter which notifications are displayed (optional)
// 'filter' => [
// 'limit' => 5, // Maximum number of notifications to show at once
// ],
// Define notification presets to simplify notification creation (optional)
// 'presets' => [
// 'entity_saved' => [
// 'type' => 'success',
// 'title' => 'Entity saved',
// 'message' => 'Entity saved successfully',
// ],
// ],
]);
```
### Configuration Options
| **Option** | **Description** |
|------------------|---------------------------------------------------------------------------------------------------------------------------|
| `default` | **String**: The default notification library to use (e.g., `'flasher'`, `'toastr'`, `'noty'`, `'notyf'`, `'sweetalert'`). |
| `main_script` | **String**: Path to the main PHPFlasher JavaScript file. |
| `styles` | **Array**: List of CSS files to style your notifications. |
| `options` | **Array** (Optional): Global options for all notifications (e.g., `'timeout'`, `'position'`). |
| `inject_assets` | **Boolean**: Whether to automatically inject JavaScript and CSS assets into your HTML pages. |
| `translate` | **Boolean**: Enable message translation using Laravels translation service. |
| `excluded_paths` | **Array**: URL patterns to exclude from asset injection and flash_bag conversion. |
| `flash_bag` | **Array**: Map Laravel flash message keys to notification types. |
| `filter` | **Array** (Optional): Criteria to filter which notifications are displayed (e.g., `'limit'`). |
| `presets` | **Array** (Optional): Define notification presets to simplify notification creation. |
## Quick Start
To display a notification message, you can either use the `flash()` helper function or obtain an instance of `flasher` from the service container. Then, before returning a view or redirecting, call the desired method (`success()`, `error()`, etc.) and pass in the message to be displayed.
### Using the `flash()` Helper
```php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class BookController extends Controller
{
public function saveBook()
{
// Your logic here
flash('Your changes have been saved!');
return redirect()->back();
}
}
```
### Using the `flasher` Service
```php
<?php
namespace App\Http\Controllers;
use Flasher\Prime\FlasherInterface;
class AnotherController extends Controller
{
/**
* If you prefer to use dependency injection
*/
public function register(FlasherInterface $flasher)
{
// Your logic here
$flasher->success('Your changes have been saved!');
// ... redirect or render the view
}
public function update()
{
// Your logic here
app('flasher')->error('An error occurred while updating.');
return redirect()->back();
}
}
```
## Usage Examples
### Success Message
```php
flash()->success('Operation completed successfully!');
```
### Error Message
```php
flash()->error('An error occurred.');
```
### Info Message
```php
flash()->info('This is an informational message.');
```
### Warning Message
```php
flash()->warning('This is a warning message.');
```
### Passing Options
```php
flash()->success('Custom message with options.', ['timeout' => 3000, 'position' => 'bottom-left']);
```
### Using presets
Define a preset in your `config/flasher.php`:
```php
<?php
declare(strict_types=1);
use Flasher\Prime\Configuration;
return Configuration::from([
// ... other configurations
'presets' => [
'entity_saved' => [
'type' => 'success',
'title' => 'Entity Saved',
'message' => 'The entity has been saved successfully.',
],
'entity_deleted' => [
'type' => 'warning',
'title' => 'Entity Deleted',
'message' => 'The entity has been deleted.',
],
],
]);
```
Use the preset in your controller:
```php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\RedirectResponse;
use App\Http\Controllers\Controller;
class BookController extends Controller
{
/**
* Save a new book entity.
*
* @return RedirectResponse
*/
public function saveBook(): RedirectResponse
{
// Your saving logic here (e.g., validating and storing the book)
// Trigger the 'entity_saved' preset
flash()->preset('entity_saved');
return redirect()->route('books.index');
}
/**
* Delete an existing book entity.
*
* @return RedirectResponse
*/
public function deleteBook(): RedirectResponse
{
// Your deletion logic here (e.g., finding and deleting the book)
// Trigger the 'entity_deleted' preset
flash()->preset('entity_deleted');
return redirect()->route('books.index');
}
}
```
## Adapters Overview
PHPFlasher supports various adapters to integrate seamlessly with different frontend libraries. Below is an overview of available adapters for Laravel:
| Adapter Repository | Description |
|-----------------------------------------------------------------------------------------|--------------------------------|
| [flasher-laravel](https://github.com/php-flasher/flasher-laravel) | Laravel framework adapter |
| [flasher-toastr-laravel](https://github.com/php-flasher/flasher-toastr-laravel) | Toastr adapter for Laravel |
| [flasher-noty-laravel](https://github.com/php-flasher/flasher-noty-laravel) | Noty adapter for Laravel |
| [flasher-notyf-laravel](https://github.com/php-flasher/flasher-notyf-laravel) | Notyf adapter for Laravel |
| [flasher-sweetalert-laravel](https://github.com/php-flasher/flasher-sweetalert-laravel) | SweetAlert adapter for Laravel |
> **Note:** Each adapter has its own repository. For detailed installation and usage instructions, please refer to the [Official Documentation](https://php-flasher.io).
## Official Documentation
Comprehensive documentation for PHPFlasher is available at [https://php-flasher.io](https://php-flasher.io). Here you will find detailed guides, API references, and advanced usage examples to help you get the most out of PHPFlasher.
## Contributors and sponsors
Join our team of contributors and make a lasting impact on our project!
We are always looking for passionate individuals who want to contribute their skills and ideas.
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration.
Shining stars of our community:
<!-- ALL-CONTRIBUTORS-LIST:START -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes--ennaji/"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes ENNAJI"/><br /><sub><b>Younes ENNAJI</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/AhmedGamal"><img src="https://avatars.githubusercontent.com/u/11786167?v=4?s=100" width="100px;" alt="Ahmed Gamal"/><br /><sub><b>Ahmed Gamal</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=AhmedGamal" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=AhmedGamal" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
## Contact
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
You can reach out with questions, bug reports, or feature requests on any of the following:
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
- [Github](https://github.com/yoeunes)
- [Twitter](https://twitter.com/yoeunes)
- [Linkedin](https://www.linkedin.com/in/younes--ennaji/)
- [Email me directly](mailto:younes.ennaji.pro@gmail.com)
## License ## License
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). [MIT](https://opensource.org/licenses/MIT)
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji/">Younes ENNAJI</a> </b> </p>
+60 -59
View File
@@ -1,80 +1,81 @@
<div align="center"> # PHPFlasher Noty Adapter (Prime)
<a href="https://github.com/php-flasher/php-flasher/blob/2.x/docs/palestine.md">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/palestine-banner-support.svg" width="800px" alt="Help Palestine"/>
</a>
</div>
<p align="center"> [![Latest Version](https://img.shields.io/packagist/v/php-flasher/flasher-noty.svg)](https://packagist.org/packages/php-flasher/flasher-noty)
<picture> [![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-noty.svg)](https://packagist.org/packages/php-flasher/flasher-noty)
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png"> [![License](https://img.shields.io/packagist/l/php-flasher/flasher-noty.svg)](https://packagist.org/packages/php-flasher/flasher-noty)
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
</picture>
</p>
## About PHPFlasher Noty adapter for PHPFlasher. Feature-rich notification library with queue support.
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects. ## Requirements
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page. - PHP >= 8.2
This improves user engagement and enhances the overall user experience on your website or application. - PHPFlasher ^2.4.0
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects. ## Installation
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
```bash
composer require php-flasher/flasher-noty
```
## Official Documentation ## Quick Start
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io). ```php
use Flasher\Noty\Prime\NotyFactory;
## Contributors and sponsors // Basic usage
Noty::success('Operation completed successfully!');
Noty::error('An error occurred.');
Noty::info('Information message.');
Noty::warning('Warning message.');
Join our team of contributors and make a lasting impact on our project! // With options
Noty::success('Success message', [
'timeout' => 3000,
'layout' => 'topCenter',
'progressBar' => true,
]);
We are always looking for passionate individuals who want to contribute their skills and ideas. // Custom notification
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration. Noty::flash('custom-type', 'Custom message');
```
Shining stars of our community: ## Features
<!-- ALL-CONTRIBUTORS-LIST:START --> - **Simple API**: `success()`, `error()`, `info()`, `warning()`, `flash()`
<!-- prettier-ignore-start --> - **Noty Options**: `layout`, `theme`, `timeout`, `progressBar`, `closeWith`
<!-- markdownlint-disable --> - **Queue Support**: Named queue system for notification ordering
<table> - **Type Safety**: Full PHP type hints and PHPStan support
<tbody> - **Helper Functions**: Global `noty()` helper for quick access
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes--ennaji//"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes ENNAJI"/><br /><sub><b>Younes ENNAJI</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore --> ## Available Methods
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END --> ```php
// Success notification
Noty::success($message, $title, $options);
## Contact // Error notification
Noty::error($message, $title, $options);
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. // Info notification
You can reach out with questions, bug reports, or feature requests on any of the following: Noty::info($message, $title, $options);
- [Github Issues](https://github.com/php-flasher/php-flasher/issues) // Warning notification
- [Github](https://github.com/yoeunes) Noty::warning($message, $title, $options);
- [Twitter](https://twitter.com/yoeunes)
- [Linkedin](https://www.linkedin.com/in/younes--ennaji//) // Custom notification type
- [Email me directly](mailto:younes.ennaji.pro@gmail.com) Noty::flash($type, $message, $title, $options);
// Set options
Noty::success($message)
->layout('topCenter')
->timeout(3000)
->theme('mint');
```
## Documentation
Complete documentation: [php-flasher.io](https://php-flasher.io)
## License ## License
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). [MIT](https://opensource.org/licenses/MIT)
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji//">Younes ENNAJI</a> </b> </p>
+35
View File
@@ -0,0 +1,35 @@
# PHPFlasher Noty Adapter
[![Latest Stable Version](https://img.shields.io/packagist/v/php-flasher/flasher-noty.svg)](https://packagist.org/packages/php-flasher/flasher-noty)
[![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-noty.svg)](https://packagist.org/packages/php-flasher/flasher-noty)
[![License](https://img.shields.io/packagist/l/php-flasher/flasher-noty.svg)](https://packagist.org/packages/php-flasher/flasher-noty)
Noty adapter for [PHPFlasher](https://php-flasher.io).
## Installation
```bash
composer require php-flasher/flasher-noty-laravel # Laravel
composer require php-flasher/flasher-noty-symfony # Symfony
```
## Quick Start
```php
// Basic usage
flash('noty')->success('Operation completed successfully!');
// With options
flash('noty')->warning('Please backup your data.', [
'timeout' => 3000,
'layout' => 'topCenter',
]);
```
## Documentation
For complete documentation, visit [php-flasher.io](https://php-flasher.io).
## License
[MIT](https://opensource.org/licenses/MIT)
+58 -59
View File
@@ -1,80 +1,79 @@
<div align="center"> # PHPFlasher Notyf Adapter (Prime)
<a href="https://github.com/php-flasher/php-flasher/blob/2.x/docs/palestine.md">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/palestine-banner-support.svg" width="800px" alt="Help Palestine"/>
</a>
</div>
<p align="center"> [![Latest Version](https://img.shields.io/packagist/v/php-flasher/flasher-notyf.svg)](https://packagist.org/packages/php-flasher/flasher-notyf)
<picture> [![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-notyf.svg)](https://packagist.org/packages/php-flasher/flasher-notyf)
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png"> [![License](https://img.shields.io/packagist/l/php-flasher/flasher-notyf.svg)](https://packagist.org/packages/php-flasher/flasher-notyf)
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
</picture>
</p>
## About PHPFlasher Notyf adapter for PHPFlasher. Lightweight and modern toast notifications.
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects. ## Requirements
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page. - PHP >= 8.2
This improves user engagement and enhances the overall user experience on your website or application. - PHPFlasher ^2.4.0
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects. ## Installation
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
```bash
composer require php-flasher/flasher-notyf
```
## Official Documentation ## Quick Start
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io). ```php
use Flasher\Notyf\Prime\NotyfFactory;
## Contributors and sponsors // Basic usage
Notyf::success('Operation completed successfully!');
Notyf::error('An error occurred.');
Notyf::info('Information message.');
Notyf::warning('Warning message.');
Join our team of contributors and make a lasting impact on our project! // With options
Notyf::success('Success message', [
'duration' => 4000,
'position' => 'top-right',
]);
We are always looking for passionate individuals who want to contribute their skills and ideas. // Custom notification
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration. Notyf::flash('custom-type', 'Custom message');
```
Shining stars of our community: ## Features
<!-- ALL-CONTRIBUTORS-LIST:START --> - **Simple API**: `success()`, `error()`, `info()`, `warning()`, `flash()`
<!-- prettier-ignore-start --> - **Notyf Options**: `duration`, `position`, `ripple`, `id`
<!-- markdownlint-disable --> - **Modern Design**: Clean, minimal design with smooth animations
<table> - **Type Safety**: Full PHP type hints and PHPStan support
<tbody> - **Helper Functions**: Global `notyf()` helper for quick access
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes--ennaji//"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes ENNAJI"/><br /><sub><b>Younes ENNAJI</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore --> ## Available Methods
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END --> ```php
// Success notification
Notyf::success($message, $title, $options);
## Contact // Error notification
Notyf::error($message, $title, $options);
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. // Info notification
You can reach out with questions, bug reports, or feature requests on any of the following: Notyf::info($message, $title, $options);
- [Github Issues](https://github.com/php-flasher/php-flasher/issues) // Warning notification
- [Github](https://github.com/yoeunes) Notyf::warning($message, $title, $options);
- [Twitter](https://twitter.com/yoeunes)
- [Linkedin](https://www.linkedin.com/in/younes--ennaji//) // Custom notification type
- [Email me directly](mailto:younes.ennaji.pro@gmail.com) Notyf::flash($type, $message, $title, $options);
// Set options
Notyf::success($message)
->duration(4000)
->position('top-right');
```
## Documentation
Complete documentation: [php-flasher.io](https://php-flasher.io)
## License ## License
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). [MIT](https://opensource.org/licenses/MIT)
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji//">Younes ENNAJI</a> </b> </p>
+35
View File
@@ -0,0 +1,35 @@
# PHPFlasher Notyf Adapter
[![Latest Stable Version](https://img.shields.io/packagist/v/php-flasher/flasher-notyf.svg)](https://packagist.org/packages/php-flasher/flasher-notyf)
[![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-notyf.svg)](https://packagist.org/packages/php-flasher/flasher-notyf)
[![License](https://img.shields.io/packagist/l/php-flasher/flasher-notyf.svg)](https://packagist.org/packages/php-flasher/flasher-notyf)
Notyf adapter for [PHPFlasher](https://php-flasher.io).
## Installation
```bash
composer require php-flasher/flasher-notyf-laravel # Laravel
composer require php-flasher/flasher-notyf-symfony # Symfony
```
## Quick Start
```php
// Basic usage
flash('notyf')->success('Operation completed successfully!');
// With options
flash('notyf')->info('New message received', [
'duration' => 4000,
'position' => 'top-right',
]);
```
## Documentation
For complete documentation, visit [php-flasher.io](https://php-flasher.io).
## License
[MIT](https://opensource.org/licenses/MIT)
+39 -61
View File
@@ -1,80 +1,58 @@
<div align="center"> # PHPFlasher Core
<a href="https://github.com/php-flasher/php-flasher/blob/2.x/docs/palestine.md">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/palestine-banner-support.svg" width="800px" alt="Help Palestine"/>
</a>
</div>
<p align="center"> [![Latest Version](https://img.shields.io/packagist/v/php-flasher/flasher.svg)](https://packagist.org/packages/php-flasher/flasher)
<picture> [![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher.svg)](https://packagist.org/packages/php-flasher/flasher)
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png"> [![License](https://img.shields.io/packagist/l/php-flasher/flasher.svg)](https://packagist.org/packages/php-flasher/flasher)
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
</picture>
</p>
## About PHPFlasher Framework-agnostic flash notifications library for PHP. Build custom integrations or use with any PHP project.
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects. ## Requirements
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page. - PHP >= 8.2
This improves user engagement and enhances the overall user experience on your website or application.
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects. ## Installation
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
```bash
composer require php-flasher/flasher
```
## Official Documentation ## Quick Start
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io). ```php
use Flasher\Prime\Flasher;
## Contributors and sponsors // Success notification
Flasher::success('Operation completed successfully!');
Join our team of contributors and make a lasting impact on our project! // Error notification
Flasher::error('An error occurred.');
We are always looking for passionate individuals who want to contribute their skills and ideas. // With options
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration. Flasher::success('Profile updated!', [
'timeout' => 5000,
'position' => 'top-right',
]);
Shining stars of our community: // With translation
Flasher::info('Welcome back!', [
'translate' => true,
'locale' => 'en',
]);
```
<!-- ALL-CONTRIBUTORS-LIST:START --> ## Key Features
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes--ennaji//"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes ENNAJI"/><br /><sub><b>Younes ENNAJI</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore --> - **Framework Agnostic**: Works with Laravel, Symfony, or any PHP project
<!-- prettier-ignore-end --> - **Plugin System**: Extensible architecture for adding custom adapters
- **Stamp Pattern**: Flexible metadata system for notifications
- **Storage Management**: Multiple storage backends (session, array, etc.)
- **Event System**: Event-driven architecture for customization
- **Response Handling**: HTML and JSON response formats
<!-- ALL-CONTRIBUTORS-LIST:END --> ## Documentation
## Contact Complete documentation: [php-flasher.io](https://php-flasher.io)
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
You can reach out with questions, bug reports, or feature requests on any of the following:
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
- [Github](https://github.com/yoeunes)
- [Twitter](https://twitter.com/yoeunes)
- [Linkedin](https://www.linkedin.com/in/younes--ennaji//)
- [Email me directly](mailto:younes.ennaji.pro@gmail.com)
## License ## License
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). [MIT](https://opensource.org/licenses/MIT)
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji//">Younes ENNAJI</a> </b> </p>
+62 -59
View File
@@ -1,80 +1,83 @@
<div align="center"> # PHPFlasher SweetAlert Adapter (Prime)
<a href="https://github.com/php-flasher/php-flasher/blob/2.x/docs/palestine.md">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/palestine-banner-support.svg" width="800px" alt="Help Palestine"/>
</a>
</div>
<p align="center"> [![Latest Version](https://img.shields.io/packagist/v/php-flasher/flasher-sweetalert.svg)](https://packagist.org/packages/php-flasher/flasher-sweetalert)
<picture> [![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-sweetalert.svg)](https://packagist.org/packages/php-flasher/flasher-sweetalert)
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png"> [![License](https://img.shields.io/packagist/l/php-flasher/flasher-sweetalert.svg)](https://packagist.org/packages/php-flasher/flasher-sweetalert)
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
</picture>
</p>
## About PHPFlasher SweetAlert2 adapter for PHPFlasher. Beautiful alert dialogs with modal and toast support.
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects. ## Requirements
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page. - PHP >= 8.2
This improves user engagement and enhances the overall user experience on your website or application. - PHPFlasher ^2.4.0
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects. ## Installation
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
```bash
composer require php-flasher/flasher-sweetalert
```
## Official Documentation ## Quick Start
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io). ```php
use Flasher\SweetAlert\Prime\SweetAlertFactory;
## Contributors and sponsors // Basic usage
SweetAlert::success('Operation completed successfully!');
SweetAlert::error('An error occurred.');
SweetAlert::info('Information message.');
SweetAlert::warning('Warning message.');
Join our team of contributors and make a lasting impact on our project! // With options
SweetAlert::success('Success message', [
'timer' => 3000,
'toast' => true,
'position' => 'top-end',
]);
We are always looking for passionate individuals who want to contribute their skills and ideas. // Modal dialog
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration. SweetAlert::success('Profile updated!')
->confirmButtonText('Great!')
->timer(5000);
```
Shining stars of our community: ## Features
<!-- ALL-CONTRIBUTORS-LIST:START --> - **Simple API**: `success()`, `error()`, `info()`, `warning()`, `flash()`
<!-- prettier-ignore-start --> - **SweetAlert2 Options**: `timer`, `toast`, `position`, `showConfirmButton`, `showCancelButton`
<!-- markdownlint-disable --> - **Modal Support**: Full SweetAlert2 modal dialogs and toasts
<table> - **Type Safety**: Full PHP type hints and PHPStan support
<tbody> - **Helper Functions**: Global `sweetalert()` helper for quick access
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes--ennaji//"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes ENNAJI"/><br /><sub><b>Younes ENNAJI</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore --> ## Available Methods
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END --> ```php
// Success notification
SweetAlert::success($message, $title, $options);
## Contact // Error notification
SweetAlert::error($message, $title, $options);
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. // Info notification
You can reach out with questions, bug reports, or feature requests on any of the following: SweetAlert::info($message, $title, $options);
- [Github Issues](https://github.com/php-flasher/php-flasher/issues) // Warning notification
- [Github](https://github.com/yoeunes) SweetAlert::warning($message, $title, $options);
- [Twitter](https://twitter.com/yoeunes)
- [Linkedin](https://www.linkedin.com/in/younes--ennaji//) // Custom notification type
- [Email me directly](mailto:younes.ennaji.pro@gmail.com) SweetAlert::flash($type, $message, $title, $options);
// Set options
SweetAlert::success($message)
->timer(3000)
->toast(true)
->position('top-end');
```
## Documentation
Complete documentation: [php-flasher.io](https://php-flasher.io)
## License ## License
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). [MIT](https://opensource.org/licenses/MIT)
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji//">Younes ENNAJI</a> </b> </p>
+35
View File
@@ -0,0 +1,35 @@
# PHPFlasher SweetAlert Adapter
[![Latest Stable Version](https://img.shields.io/packagist/v/php-flasher/flasher-sweetalert.svg)](https://packagist.org/packages/php-flasher/flasher-sweetalert)
[![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-sweetalert.svg)](https://packagist.org/packages/php-flasher/flasher-sweetalert)
[![License](https://img.shields.io/packagist/l/php-flasher/flasher-sweetalert.svg)](https://packagist.org/packages/php-flasher/flasher-sweetalert)
SweetAlert2 adapter for [PHPFlasher](https://php-flasher.io).
## Installation
```bash
composer require php-flasher/flasher-sweetalert-laravel # Laravel
composer require php-flasher/flasher-sweetalert-symfony # Symfony
```
## Quick Start
```php
// Basic usage
flash('sweetalert')->success('Operation completed successfully!');
// With options
flash('sweetalert')->info('New message', [
'timer' => 3000,
'toast' => true,
]);
```
## Documentation
For complete documentation, visit [php-flasher.io](https://php-flasher.io).
## License
[MIT](https://opensource.org/licenses/MIT)
+41 -362
View File
@@ -1,394 +1,73 @@
<div align="center"> # PHPFlasher Symfony Adapter
<a href="https://github.com/php-flasher/php-flasher/blob/2.x/docs/palestine.md">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/palestine-banner-support.svg" width="800px" alt="Help Palestine"/>
</a>
</div>
<p align="center"> [![Latest Version](https://img.shields.io/packagist/v/php-flasher/flasher-symfony.svg)](https://packagist.org/packages/php-flasher/flasher-symfony)
<picture> [![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-symfony.svg)](https://packagist.org/packages/php-flasher/flasher-symfony)
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo-dark.png"> [![License](https://img.shields.io/packagist/l/php-flasher/flasher-symfony.svg)](https://packagist.org/packages/php-flasher/flasher-symfony)
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo.png" alt="PHPFlasher Logo">
</picture>
</p>
<p align="center"> Symfony framework adapter for PHPFlasher. Seamless integration with zero JavaScript setup.
<a href="https://www.linkedin.com/in/younes--ennaji"><img src="https://img.shields.io/badge/author-@yoeunes-blue.svg" alt="Author Badge"></a>
<a href="https://github.com/php-flasher/php-flasher"><img src="https://img.shields.io/badge/source-php--flasher/php--flasher-blue.svg" alt="Source Code Badge"></a>
<a href="https://github.com/php-flasher/php-flasher/releases"><img src="https://img.shields.io/github/tag/php-flasher/flasher.svg" alt="GitHub Release Badge"></a>
<a href="https://github.com/php-flasher/flasher/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="License Badge"></a>
<a href="https://packagist.org/packages/php-flasher/flasher"><img src="https://img.shields.io/packagist/dt/php-flasher/flasher.svg" alt="Packagist Downloads Badge"></a>
<a href="https://github.com/php-flasher/php-flasher"><img src="https://img.shields.io/github/stars/php-flasher/php-flasher.svg" alt="GitHub Stars Badge"></a>
<a href="https://packagist.org/packages/php-flasher/flasher"><img src="https://img.shields.io/packagist/php-v/php-flasher/flasher.svg" alt="Supported PHP Version Badge"></a>
</p>
## Table of Contents ## Requirements
- [About PHPFlasher Symfony Adapter](#about-phpflasher-symfony-adapter) - PHP >= 8.2
- [Features](#features) - Symfony >= 7.0
- [Supported Versions](#supported-versions)
- [Installation](#installation)
- [Core Package](#core-package)
- [Adapters](#adapters)
- [Configuration](#configuration)
- [Configuration File](#configuration-file)
- [Configuration Options](#configuration-options)
- [Quick Start](#quick-start)
- [Usage Examples](#usage-examples)
- [Adapters Overview](#adapters-overview)
- [Official Documentation](#official-documentation)
- [Contributors and Sponsors](#contributors-and-sponsors)
- [Contact](#contact)
- [License](#license)
## About PHPFlasher Symfony Adapter
**PHPFlasher Symfony Adapter** is an open-source package that seamlessly integrates PHPFlashers robust flash messaging capabilities into your **Symfony** applications. It streamlines the process of adding flash messages, offering an intuitive API to enhance user experience with minimal configuration.
With PHPFlasher Symfony Adapter, you can effortlessly display success, error, warning, and informational messages to your users, ensuring clear communication of application states and actions.
## Features
- **Seamless Symfony Integration**: Designed specifically for Symfony, ensuring compatibility and ease of use.
- **Multiple Notification Libraries**: Supports various frontend libraries like Toastr, Noty, SweetAlert, and Notyf.
- **Flexible Configuration**: Customize the appearance and behavior of flash messages to fit your application's needs.
- **Intuitive API**: Simple methods to create and manage flash messages without boilerplate code.
- **Extensible**: Easily add or create new adapters for different frontend libraries.
## Supported Versions
| PHPFlasher Symfony Adapter Version | PHP Version | Symfony Version |
|------------------------------------|-------------|-----------------|
| **v2.x** | ≥ 8.2 | ≥ 7.0 |
| **v1.x** | ≥ 5.3 | ≥ 2.0 |
> **Note:** Ensure your project meets the PHP and Symfony version requirements for the PHPFlasher Symfony Adapter version you intend to use. For older PHP or Symfony versions, refer to [PHPFlasher v1.x](https://github.com/php-flasher/flasher-symfony/tree/1.x).
## Installation ## Installation
### Core Package
Install the PHPFlasher Symfony Adapter via Composer:
```bash ```bash
composer require php-flasher/flasher-symfony composer require php-flasher/flasher-symfony
``` ```
After installation, set up the necessary assets: Run the install command:
```shell ```bash
php bin/console flasher:install php bin/console flasher:install
``` ```
> **Note:** PHPFlasher automatically injects the necessary JavaScript and CSS assets into your Blade templates. No additional steps are required for asset injection. ## Quick Start
### Adapters ```php
// Success notification
flash('Your changes have been saved!');
PHPFlasher provides various adapters for different notification libraries. Below is an overview of available adapters for Symfony: // In controller
public function save(): Response
{
// Your logic...
- [flasher-toastr-symfony](https://github.com/php-flasher/flasher-toastr-symfony) - Symfony Adapter flash('Operation completed successfully!');
- [flasher-noty-symfony](https://github.com/php-flasher/flasher-noty-symfony) - Symfony Adapter
- [flasher-notyf-symfony](https://github.com/php-flasher/flasher-notyf-symfony) - Symfony Adapter
- [flasher-sweetalert-symfony](https://github.com/php-flasher/flasher-sweetalert-symfony) - Symfony Adapter
For detailed installation and usage instructions for each adapter, refer to their respective `README.md`. return $this->redirectToRoute('home');
}
// With dependency injection
public function save(FlasherInterface $flasher): Response
{
// Your logic...
$flasher->success('Changes saved!');
return $this->redirectToRoute('home');
}
```
## Configuration ## Configuration
After installing the PHPFlasher Symfony Adapter, you can configure it by publishing the configuration file or by modifying it directly. Publish configuration file:
### Configuration File
If you need to customize the default settings, publish the configuration file using the following command:
```bash ```bash
php bin/console flasher:install --config php bin/console flasher:install --config
``` ```
This will create a file at `config/packages/flasher.yaml` with the following content: This creates `config/packages/flasher.yaml` where you can customize:
- Default adapter
- Global options
- Flash bag mapping
- Presets
```yaml ## Documentation
flasher:
# Default notification library (e.g., 'flasher', 'toastr', 'noty', 'notyf', 'sweetalert')
default: flasher
# Path to the main PHPFlasher JavaScript file Complete documentation: [php-flasher.io](https://php-flasher.io)
main_script: '/vendor/flasher/flasher.min.js'
# List of CSS files to style your notifications
styles:
- '/vendor/flasher/flasher.min.css'
# Set global options for all notifications (optional)
# options:
# # Time in milliseconds before the notification disappears
# timeout: 5000
# # Where the notification appears on the screen
# position: 'top-right'
# Automatically inject JavaScript and CSS assets into your HTML pages
inject_assets: true
# Enable message translation using Symfony's translation service
translate: true
# URL patterns to exclude from asset injection and flash_bag conversion
excluded_paths:
- '/^\/_profiler/'
- '/^\/_fragment/'
# Map Symfony flash message keys to notification types
flash_bag:
success: ['success']
error: ['error', 'danger']
warning: ['warning', 'alarm']
info: ['info', 'notice', 'alert']
# Set criteria to filter which notifications are displayed (optional)
# filter:
# # Maximum number of notifications to show at once
# limit: 5
# Define notification presets to simplify notification creation (optional)
# presets:
# # Example preset:
# entity_saved:
# type: 'success'
# title: 'Entity saved'
# message: 'Entity saved successfully'
```
### Configuration Options
| **Option** | **Description** |
|------------------|---------------------------------------------------------------------------------------------------------------------------|
| `default` | **String**: The default notification library to use (e.g., `'flasher'`, `'toastr'`, `'noty'`, `'notyf'`, `'sweetalert'`). |
| `main_script` | **String**: Path to the main PHPFlasher JavaScript file. |
| `styles` | **Array**: List of CSS files to style your notifications. |
| `options` | **Array** (Optional): Global options for all notifications (e.g., `'timeout'`, `'position'`). |
| `inject_assets` | **Boolean**: Whether to automatically inject JavaScript and CSS assets into your HTML pages. |
| `translate` | **Boolean**: Enable message translation using Symfonys translation service. |
| `excluded_paths` | **Array**: URL patterns to exclude from asset injection and flash_bag conversion. |
| `flash_bag` | **Array**: Map Symfony flash message keys to notification types. |
| `filter` | **Array** (Optional): Criteria to filter which notifications are displayed (e.g., `'limit'`). |
| `presets` | **Array** (Optional): Define notification presets to simplify notification creation. |
## Quick Start
To display a notification message, you can either use the `flash()` helper function or obtain an instance of `flasher` from the service container. Then, before returning a view or redirecting, call the desired method (`success()`, `error()`, etc.) and pass in the message to be displayed.
### Using the `flash()` Helper
```php
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
class BookController extends AbstractController
{
public function saveBook(): RedirectResponse
{
// Your logic here
flash('Your changes have been saved!');
return $this->redirectToRoute('book_list');
}
}
```
### Using the `flasher` Service
```php
<?php
namespace App\Controller;
use Flasher\Prime\FlasherInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
class AnotherController extends AbstractController
{
private FlasherInterface $flasher;
public function __construct(FlasherInterface $flasher)
{
$this->flasher = $flasher;
}
public function register(): RedirectResponse
{
// Your logic here
$this->flasher->success('Your changes have been saved!');
// ... redirect or render the view
return $this->redirectToRoute('home');
}
public function update(): RedirectResponse
{
// Your logic here
$this->flasher->error('An error occurred while updating.');
return $this->redirectToRoute('update_page');
}
}
```
## Usage Examples
### Success Message
```php
flash()->success('Operation completed successfully!');
```
### Error Message
```php
flash()->error('An error occurred.');
```
### Info Message
```php
flash()->info('This is an informational message.');
```
### Warning Message
```php
flash()->warning('This is a warning message.');
```
### Passing Options
```php
flash()->success('Custom message with options.', ['timeout' => 3000, 'position' => 'bottom-left']);
```
### Using presets
Define a preset in your `config/packages/flasher.yaml`:
```yaml
flasher:
# ... other configurations
presets:
entity_saved:
type: 'success'
title: 'Entity Saved'
message: 'The entity has been saved successfully.'
entity_deleted:
type: 'warning'
title: 'Entity Deleted'
message: 'The entity has been deleted.'
```
Use the preset in your controller:
```php
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
class BookController extends AbstractController
{
public function save(): RedirectResponse
{
// Your saving logic
flash()->preset('entity_saved');
return $this->redirectToRoute('books.index');
}
public function delete(): RedirectResponse
{
// Your deletion logic
flash()->preset('entity_deleted');
return $this->redirectToRoute('books.index');
}
}
```
## Adapters Overview
PHPFlasher supports various adapters to integrate seamlessly with different frontend libraries. Below is an overview of available adapters for Symfony:
| Adapter Repository | Description |
|-----------------------------------------------------------------------------------------|--------------------------------|
| [flasher-symfony](https://github.com/php-flasher/flasher-symfony) | Symfony framework adapter |
| [flasher-toastr-symfony](https://github.com/php-flasher/flasher-toastr-symfony) | Toastr adapter for Symfony |
| [flasher-noty-symfony](https://github.com/php-flasher/flasher-noty-symfony) | Noty adapter for Symfony |
| [flasher-notyf-symfony](https://github.com/php-flasher/flasher-notyf-symfony) | Notyf adapter for Symfony |
| [flasher-sweetalert-symfony](https://github.com/php-flasher/flasher-sweetalert-symfony) | SweetAlert adapter for Symfony |
> **Note:** Each adapter has its own repository. For detailed installation and usage instructions, please refer to the [Official Documentation](https://php-flasher.io).
## Official Documentation
Comprehensive documentation for PHPFlasher is available at [https://php-flasher.io](https://php-flasher.io). Here you will find detailed guides, API references, and advanced usage examples to help you get the most out of PHPFlasher.
## Contributors and sponsors
Join our team of contributors and make a lasting impact on our project!
We are always looking for passionate individuals who want to contribute their skills and ideas.
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration.
Shining stars of our community:
<!-- ALL-CONTRIBUTORS-LIST:START -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes--ennaji/"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes ENNAJI"/><br /><sub><b>Younes ENNAJI</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/AhmedGamal"><img src="https://avatars.githubusercontent.com/u/11786167?v=4?s=100" width="100px;" alt="Ahmed Gamal"/><br /><sub><b>Ahmed Gamal</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=AhmedGamal" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=AhmedGamal" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
## Contact
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
You can reach out with questions, bug reports, or feature requests on any of the following:
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
- [Github](https://github.com/yoeunes)
- [Twitter](https://twitter.com/yoeunes)
- [Linkedin](https://www.linkedin.com/in/younes--ennaji/)
- [Email me directly](mailto:younes.ennaji.pro@gmail.com)
## License ## License
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). [MIT](https://opensource.org/licenses/MIT)
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji/">Younes ENNAJI</a> </b> </p>
+64 -59
View File
@@ -1,80 +1,85 @@
<div align="center"> # PHPFlasher Toastr - Laravel Adapter
<a href="https://github.com/php-flasher/php-flasher/blob/2.x/docs/palestine.md">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/palestine-banner-support.svg" width="800px" alt="Help Palestine"/>
</a>
</div>
<p align="center"> [![Latest Version](https://img.shields.io/packagist/v/php-flasher/flasher-toastr-laravel.svg)](https://packagist.org/packages/php-flasher/flasher-toastr-laravel)
<picture> [![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-toastr-laravel.svg)](https://packagist.org/packages/php-flasher/flasher-toastr-laravel)
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png"> [![License](https://img.shields.io/packagist/l/php-flasher/flasher-toastr-laravel.svg)](https://packagist.org/packages/php-flasher/flasher-toastr-laravel)
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
</picture>
</p>
## About PHPFlasher Laravel adapter for PHPFlasher Toastr. Seamlessly integrate Toastr notifications into Laravel applications.
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects. ## Requirements
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page. - PHP >= 8.2
This improves user engagement and enhances the overall user experience on your website or application. - Laravel >= 11.0
- php-flasher/flasher-laravel ^2.4.0
- php-flasher/flasher-toastr ^2.4.0
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects. ## Installation
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
```bash
composer require php-flasher/flasher-toastr-laravel
```
## Official Documentation ## Quick Start
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io). ```php
// Global helper
toastr()->success('Operation completed successfully!');
toastr()->error('An error occurred.');
toastr()->info('Information message.');
toastr()->warning('Warning message.');
## Contributors and sponsors // In controller
public function save(Request $request)
{
// Your logic...
Join our team of contributors and make a lasting impact on our project! toastr()->success('Changes saved!');
We are always looking for passionate individuals who want to contribute their skills and ideas. return redirect()->back();
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration. }
Shining stars of our community: // With options
toastr()->success('Success message', [
'timeOut' => 5000,
'positionClass' => 'toast-top-right',
]);
```
<!-- ALL-CONTRIBUTORS-LIST:START --> ## Features
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes--ennaji//"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes ENNAJI"/><br /><sub><b>Younes ENNAJI</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore --> - **Laravel Facade**: `toastr()` global helper
<!-- prettier-ignore-end --> - **Dependency Injection**: `ToastrFactory` type-hinted injection
- **Laravel Integration**: Auto-injects assets in Blade templates
- **Flash Bag**: Converts Laravel flash messages to Toastr notifications
<!-- ALL-CONTRIBUTORS-LIST:END --> ## Configuration
## Contact Publish configuration:
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. ```bash
You can reach out with questions, bug reports, or feature requests on any of the following: php artisan flasher:install --config
```
- [Github Issues](https://github.com/php-flasher/php-flasher/issues) Add to `config/flasher.php`:
- [Github](https://github.com/yoeunes)
- [Twitter](https://twitter.com/yoeunes) ```php
- [Linkedin](https://www.linkedin.com/in/younes--ennaji//) return [
- [Email me directly](mailto:younes.ennaji.pro@gmail.com) 'plugins' => [
'toastr' => [
'options' => [
'timeOut' => 5000,
'progressBar' => true,
'positionClass' => 'toast-top-right',
],
],
],
];
```
## Documentation
Complete documentation: [php-flasher.io](https://php-flasher.io)
## License ## License
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). [MIT](https://opensource.org/licenses/MIT)
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji//">Younes ENNAJI</a> </b> </p>
+37 -62
View File
@@ -1,80 +1,55 @@
<div align="center"> # PHPFlasher Toastr Adapter (Prime)
<a href="https://github.com/php-flasher/php-flasher/blob/2.x/docs/palestine.md">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/palestine-banner-support.svg" width="800px" alt="Help Palestine"/>
</a>
</div>
<p align="center"> [![Latest Version](https://img.shields.io/packagist/v/php-flasher/flasher-toastr.svg)](https://packagist.org/packages/php-flasher/flasher-toastr)
<picture> [![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-toastr.svg)](https://packagist.org/packages/php-flasher/flasher-toastr)
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png"> [![License](https://img.shields.io/packagist/l/php-flasher/flasher-toastr.svg)](https://packagist.org/packages/php-flasher/flasher-toastr)
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
</picture>
</p>
## About PHPFlasher Toastr adapter for PHPFlasher. Elegant toast notifications with full TypeScript support.
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects. ## Requirements
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page. - PHP >= 8.2
This improves user engagement and enhances the overall user experience on your website or application. - PHPFlasher ^2.4.0
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects. ## Installation
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
```bash
composer require php-flasher/flasher-toastr
```
## Official Documentation ## Quick Start
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io). ```php
use Flasher\Toastr\Prime\ToastrFactory;
## Contributors and sponsors // Basic usage
Toastr::success('Operation completed successfully!');
Toastr::error('An error occurred.');
Toastr::info('Information message.');
Toastr::warning('Warning message.');
Join our team of contributors and make a lasting impact on our project! // With options
Toastr::success('Success message', [
'timeOut' => 5000,
'positionClass' => 'toast-top-right',
'progressBar' => true,
]);
We are always looking for passionate individuals who want to contribute their skills and ideas. // Custom notification
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration. Toastr::flash('custom-type', 'Custom message');
```
Shining stars of our community: ## Features
<!-- ALL-CONTRIBUTORS-LIST:START --> - **Simple API**: `success()`, `error()`, `info()`, `warning()`, `flash()`
<!-- prettier-ignore-start --> - **Toastr Options**: `timeOut`, `positionClass`, `progressBar`, `closeButton`, `newestOnTop`
<!-- markdownlint-disable --> - **Type Safety**: Full PHP type hints and PHPStan support
<table> - **Helper Functions**: Global `toastr()` helper for quick access
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes--ennaji//"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes ENNAJI"/><br /><sub><b>Younes ENNAJI</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore --> ## Documentation
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END --> Complete documentation: [php-flasher.io](https://php-flasher.io)
## Contact
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
You can reach out with questions, bug reports, or feature requests on any of the following:
- [Github Issues](https://github.com/php-flasher/php-flasher/issues)
- [Github](https://github.com/yoeunes)
- [Twitter](https://twitter.com/yoeunes)
- [Linkedin](https://www.linkedin.com/in/younes--ennaji//)
- [Email me directly](mailto:younes.ennaji.pro@gmail.com)
## License ## License
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). [MIT](https://opensource.org/licenses/MIT)
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji//">Younes ENNAJI</a> </b> </p>
+35
View File
@@ -0,0 +1,35 @@
# PHPFlasher Toastr Adapter
[![Latest Stable Version](https://img.shields.io/packagist/v/php-flasher/flasher-toastr.svg)](https://packagist.org/packages/php-flasher/flasher-toastr)
[![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-toastr.svg)](https://packagist.org/packages/php-flasher/flasher-toastr)
[![License](https://img.shields.io/packagist/l/php-flasher/flasher-toastr.svg)](https://packagist.org/packages/php-flasher/flasher-toastr)
Toastr adapter for [PHPFlasher](https://php-flasher.io).
## Installation
```bash
composer require php-flasher/flasher-toastr-laravel # Laravel
composer require php-flasher/flasher-toastr-symfony # Symfony
```
## Quick Start
```php
// Basic usage
flash('toastr')->success('Operation completed successfully!');
// With options
flash('toastr')->info('New message received', [
'timeOut' => 5000,
'positionClass' => 'toast-top-right',
]);
```
## Documentation
For complete documentation, visit [php-flasher.io](https://php-flasher.io).
## License
[MIT](https://opensource.org/licenses/MIT)
+56 -59
View File
@@ -1,80 +1,77 @@
<div align="center"> # PHPFlasher Toastr - Symfony Adapter
<a href="https://github.com/php-flasher/php-flasher/blob/2.x/docs/palestine.md">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/palestine-banner-support.svg" width="800px" alt="Help Palestine"/>
</a>
</div>
<p align="center"> [![Latest Version](https://img.shields.io/packagist/v/php-flasher/flasher-toastr-symfony.svg)](https://packagist.org/packages/php-flasher/flasher-toastr-symfony)
<picture> [![Total Downloads](https://img.shields.io/packagist/dt/php-flasher/flasher-toastr-symfony.svg)](https://packagist.org/packages/php-flasher/flasher-toastr-symfony)
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png"> [![License](https://img.shields.io/packagist/l/php-flasher/flasher-toastr-symfony.svg)](https://packagist.org/packages/php-flasher/flasher-toastr-symfony)
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
</picture>
</p>
## About PHPFlasher Symfony adapter for PHPFlasher Toastr. Seamlessly integrate Toastr notifications into Symfony applications.
PHPFlasher is a powerful and easy-to-use package that allows you to quickly and easily add flash messages to your Laravel or Symfony projects. ## Requirements
Whether you need to alert users of a successful form submission, an error, or any other important information, flash messages are a simple and effective solution for providing feedback to your users.
With PHPFlasher, you can easily record and store messages within the session, making it simple to retrieve and display them on the current or next page. - PHP >= 8.2
This improves user engagement and enhances the overall user experience on your website or application. - Symfony >= 7.0
- php-flasher/flasher-symfony ^2.4.0
- php-flasher/flasher-toastr ^2.4.0
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects. ## Installation
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
```bash
composer require php-flasher/flasher-toastr-symfony
```
## Official Documentation ## Quick Start
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io). ```php
// Global helper
toastr('Your changes have been saved!');
## Contributors and sponsors // In controller
public function save(): RedirectResponse
{
// Your logic...
Join our team of contributors and make a lasting impact on our project! toastr('Operation completed successfully!');
We are always looking for passionate individuals who want to contribute their skills and ideas. return $this->redirectToRoute('home');
Whether you're a developer, designer, or simply have a great idea, we welcome your participation and collaboration. }
Shining stars of our community: // With options
toastr('Success message', [
'timeOut' => 5000,
'positionClass' => 'toast-top-right',
]);
```
<!-- ALL-CONTRIBUTORS-LIST:START --> ## Features
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/younes--ennaji//"><img src="https://avatars.githubusercontent.com/u/10859693?v=4?s=100" width="100px;" alt="Younes ENNAJI"/><br /><sub><b>Younes ENNAJI</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Code">💻</a> <a href="https://github.com/php-flasher/php-flasher/commits?author=yoeunes" title="Documentation">📖</a> <a href="#maintenance-yoeunes" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/salmayno"><img src="https://avatars.githubusercontent.com/u/27933199?v=4?s=100" width="100px;" alt="Salma Mourad"/><br /><sub><b>Salma Mourad</b></sub></a><br /><a href="#financial-salmayno" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.youtube.com/rstacode"><img src="https://avatars.githubusercontent.com/u/35005761?v=4?s=100" width="100px;" alt="Nashwan Abdullah"/><br /><sub><b>Nashwan Abdullah</b></sub></a><br /><a href="#financial-codenashwan" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://darvis.nl/"><img src="https://avatars.githubusercontent.com/u/7394837?v=4?s=100" width="100px;" alt="Arvid de Jong"/><br /><sub><b>Arvid de Jong</b></sub></a><br /><a href="#financial-darviscommerce" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ashallendesign.co.uk/"><img src="https://avatars.githubusercontent.com/u/39652331?v=4?s=100" width="100px;" alt="Ash Allen"/><br /><sub><b>Ash Allen</b></sub></a><br /><a href="#design-ash-jc-allen" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/murrant"><img src="https://avatars.githubusercontent.com/u/39462?v=4?s=100" width="100px;" alt="Tony Murray"/><br /><sub><b>Tony Murray</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=murrant" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/n3wborn"><img src="https://avatars.githubusercontent.com/u/10246722?v=4?s=100" width="100px;" alt="Stéphane P"/><br /><sub><b>Stéphane P</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=n3wborn" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.instagram.com/lucas.maciel_z"><img src="https://avatars.githubusercontent.com/u/80225404?v=4?s=100" width="100px;" alt="Lucas Maciel"/><br /><sub><b>Lucas Maciel</b></sub></a><br /><a href="#design-LucasStorm" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://siek.io/"><img src="https://avatars.githubusercontent.com/u/5730766?v=4?s=100" width="100px;" alt="Antoni Siek"/><br /><sub><b>Antoni Siek</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=ImJustToNy" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore --> - **Symfony Helper**: `toastr()` global function
<!-- prettier-ignore-end --> - **Service Injection**: `ToastrFactory` autowired in constructors
- **Twig Integration**: Auto-injects assets in Twig templates
- **Flash Bag**: Converts Symfony flash messages to Toastr notifications
<!-- ALL-CONTRIBUTORS-LIST:END --> ## Configuration
## Contact Publish configuration:
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>. ```bash
You can reach out with questions, bug reports, or feature requests on any of the following: php bin/console flasher:install --config
```
- [Github Issues](https://github.com/php-flasher/php-flasher/issues) Add to `config/packages/flasher.yaml`:
- [Github](https://github.com/yoeunes)
- [Twitter](https://twitter.com/yoeunes) ```yaml
- [Linkedin](https://www.linkedin.com/in/younes--ennaji//) flasher:
- [Email me directly](mailto:younes.ennaji.pro@gmail.com) toastr:
options:
timeOut: 5000
progressBar: true
positionClass: toast-top-right
```
## Documentation
Complete documentation: [php-flasher.io](https://php-flasher.io)
## License ## License
PHPFlasher is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). [MIT](https://opensource.org/licenses/MIT)
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji//">Younes ENNAJI</a> </b> </p>