Compare commits

...

32 Commits

Author SHA1 Message Date
Younes ENNAJI aee6d2764a Merge pull request #216 from php-flasher/v2.1.5
prepare for v2.1.5
2025-02-21 18:55:10 +01:00
Younes ENNAJI a26cac3a07 prepare for v2.1.5 2025-02-21 18:52:39 +01:00
Younes ENNAJI 811fc1a5eb Merge pull request #215 from php-flasher/v2.1.4
chore: bump flasher dependency to v2.1.4
2025-02-18 14:02:26 +01:00
Younes ENNAJI 1b3b0bd08f add support for laravel v12 2025-02-18 14:01:24 +01:00
Younes ENNAJI 7972fd2d46 chore: bump flasher dependency to v2.1.4 2025-02-18 13:58:18 +01:00
Younes ENNAJI 31e2725566 Merge pull request #214 from php-flasher/issues/213
Fix PHPStan issue by removing includes section from composer.json
2025-02-18 13:54:49 +01:00
Younes ENNAJI b31695ff58 Remove phpstan includes section from composer.json 2025-02-18 13:51:41 +01:00
Younes ENNAJI a314692534 update assets version in package.json to v2.1.3 2025-01-25 14:59:20 +01:00
Younes ENNAJI 9de126bb55 update CHANGELOG 2025-01-25 14:38:48 +01:00
Younes ENNAJI f66382e324 Merge pull request #211 from ToshY/feature/208
Add GitHub workflow for automatic publishing of assets to NPM
2025-01-25 14:31:49 +01:00
ToshY e2ef4f08a4 add workflow for automatic publishing of assets to NPM 2025-01-23 00:24:45 +01:00
Younes ENNAJI 1e1b70e59b docs: upgrade dependencies and build assets 2025-01-19 18:50:40 +01:00
Younes ENNAJI 0ca4b5c197 Merge pull request #210 from php-flasher/upgrade-dependencies
upgrade dependencies
2025-01-18 11:34:10 +01:00
Younes ENNAJI df8eb83abe chore: update CHANGELOG 2025-01-18 11:30:44 +01:00
Younes ENNAJI 3f1b22a126 chore: bump flasher dependency to v2.1.2 2025-01-18 11:26:31 +01:00
Younes ENNAJI b11524c2f9 update demo files 2025-01-18 11:23:18 +01:00
Younes ENNAJI a2333762ea build documentation 2025-01-18 11:23:18 +01:00
Younes ENNAJI 3e2e853022 upgrade dependencies 2025-01-18 11:23:17 +01:00
Younes ENNAJI 27904be912 Merge pull request #209 from php-flasher/issues/208
feat: make mainScript nullable
2025-01-18 11:22:59 +01:00
Younes ENNAJI c9d3b56346 feat: make mainScript nullable 2025-01-17 10:28:13 +01:00
Younes ENNAJI db485d1ff2 Merge pull request #207 from BrookeDot/patch-2
Update Flasher Class Parameter Order
2024-11-09 00:38:24 +01:00
Brooke. 707c7a42e1 Update Flasher Class Parameter Order
The order of `$title` and `$options` has changed, if one tries to pass a string to parameter three ($options) an error is thrown. This updates the docs accordingly.

Looks like the order was changed here:
https://github.com/php-flasher/php-flasher/blob/2.x/src/Prime/helpers.php#L21-L36
2024-11-08 13:33:52 -08:00
Younes ENNAJI 456016a585 docs: update contributors list 2024-11-06 22:52:07 +01:00
Younes ENNAJI a38ddbb53a Merge pull request #206 from BrookeDot/patch-1
Fix 404s and add links to new Guides to Getting Started
2024-11-06 22:43:03 +01:00
Brooke. 5a73173dcf Fix 404s and add links to new Guides to Getting Started
Fixes the 404s for Laravel and Symfony links (due to case sensitivity) and adds the Livewire and Inertia guides to the Getting Started section
2024-11-06 13:23:50 -08:00
Younes ENNAJI 7abdccf284 Add PR template and auto-close PR on subtree split repositories 2024-10-27 16:04:49 +01:00
Younes ENNAJI a34a943397 docs: update laravel README.md add preset example 2024-10-27 15:31:54 +01:00
Younes ENNAJI fe4601bb8b docs: update symfony README.md file 2024-10-27 15:29:49 +01:00
Younes ENNAJI 86a56f4cff docs: update laravel markdown file 2024-10-27 15:02:54 +01:00
Younes ENNAJI c3493a7335 docs: update header links inside of README.md file 2024-10-27 14:16:24 +01:00
Younes ENNAJI b2a102023b docs: update README.md file 2024-10-27 14:12:39 +01:00
Younes ENNAJI 2a85dc37c3 chore: upgrade dependencies 2024-10-27 12:16:39 +01:00
108 changed files with 12547 additions and 6435 deletions
+9
View File
@@ -95,6 +95,15 @@
"code",
"doc"
]
},
{
"login": "BrookeDot",
"name": "Brooke.",
"avatar_url": "https://avatars.githubusercontent.com/u/150348?v=4",
"profile": "https://github.com/BrookeDot",
"contributions": [
"doc"
]
}
]
}
+61
View File
@@ -0,0 +1,61 @@
name: 🚀 Publish assets to NPM
on:
release:
types: [ published ]
jobs:
publish-prime:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/Prime/Resources
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-plugin:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
path:
- ./src/Noty/Prime/Resources
- ./src/Notyf/Prime/Resources
- ./src/SweetAlert/Prime/Resources
- ./src/Toastr/Prime/Resources
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
working-directory: ${{ matrix.path }}
- name: Publish to NPM
run: npm publish --access public
working-directory: ${{ matrix.path }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+20
View File
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+9 -1
View File
@@ -1,6 +1,14 @@
# CHANGELOG for 2.x
## [Unreleased](https://github.com/php-flasher/php-flasher/compare/v2.1.1...2.x)
## [Unreleased](https://github.com/php-flasher/php-flasher/compare/v2.1.4...2.x)
## [v2.1.3](https://github.com/php-flasher/php-flasher/compare/v2.1.2...v2.1.3) - 2025-01-25
* bug [#208](https://github.com/php-flasher/php-flasher/issues/208) [Flasher] Add GitHub workflow for automatic publishing of assets to NPM. See [PR #211](https://github.com/php-flasher/php-flasher/pull/211) by [ToshY](https://github.com/ToshY)
## [v2.1.2](https://github.com/php-flasher/php-flasher/compare/v2.1.1...v2.1.2) - 2025-01-18
* bug [#208](https://github.com/php-flasher/php-flasher/issues/208) [Flasher] Allow `main_script` to be nullable. See [PR #209](https://github.com/php-flasher/php-flasher/pull/209) by [yoeunes](https://github.com/yoeunes)
## [v2.1.1](https://github.com/php-flasher/php-flasher/compare/v2.1.0...v2.1.1) - 2024-10-20
+211 -9
View File
@@ -6,26 +6,227 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo-dark.png">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo.png" alt="PHPFlasher Logo">
</picture>
</p>
<p align="center">
<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
- [About PHPFlasher](#about-phpflasher)
- [Features](#features)
- [Supported Versions](#supported-versions)
- [Installation](#installation)
- [Core Package](#core-package)
- [Adapters](#adapters)
- [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
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.
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.
PHPFlasher is an open-source tool that helps you add flash messages to your web applications. Flash messages are short notifications that provide feedback to users after they perform actions, such as submitting a form or encountering an error. These messages enhance the user experience by informing users about the outcomes of their actions.
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.
This improves user engagement and enhances the overall user experience on your website or application.
PHPFlasher simplifies the process of integrating flash messages into **Laravel** and **Symfony** projects. It uses sessions to store messages, allowing you to set a message on one page and display it on another without complex setup.
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects.
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
## Features
- **Multiple Adapters**: Supports Laravel, Symfony, Toastr, Noty, SweetAlert, and more.
- **Flexible Configuration**: Customize the appearance and behavior of flash messages.
- **Extensible**: Easily integrate with various frontend libraries and frameworks.
- **Intuitive API**: Simple functions to create and manage flash messages.
## Supported Versions
| PHPFlasher Version | PHP Version | Symfony Version | Laravel Version |
|--------------------|-------------|-----------------|-----------------|
| **v2.x** | ≥ 8.2 | ≥ 7.2 | ≥ 11 |
| **v1.x** | ≥ 5.3 | ≥ 2.0 | ≥ 4.0 |
> **Note:** If your project uses PHP, Symfony, or Laravel versions below the requirements for PHPFlasher v2.x, please use [PHPFlasher v1.x](https://github.com/php-flasher/php-flasher/tree/1.x).
## Installation
### Core Package
Install the core PHPFlasher package via Composer:
- **For Laravel:**
```bash
composer require php-flasher/flasher-laravel
```
After installation, set up the necessary assets:
```shell
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.
- **For Symfony:**
```bash
composer require php-flasher/flasher-symfony
```
After installation, set up the necessary assets:
```shell
php bin/console flasher:install
```
> **Note:** PHPFlasher automatically injects the necessary JavaScript and CSS assets into your Twig templates. No additional steps are required for asset injection.
### Adapters
PHPFlasher provides various adapters for different frameworks and notification libraries. Below is an overview of available adapters:
#### Toastr
- [flasher-toastr](https://github.com/php-flasher/flasher-toastr) - Core Toastr Adapter
- [flasher-toastr-laravel](https://github.com/php-flasher/flasher-toastr-laravel) - Laravel Adapter
- [flasher-toastr-symfony](https://github.com/php-flasher/flasher-toastr-symfony) - Symfony Adapter
#### Noty
- [flasher-noty](https://github.com/php-flasher/flasher-noty) - Core Noty Adapter
- [flasher-noty-laravel](https://github.com/php-flasher/flasher-noty-laravel) - Laravel Adapter
- [flasher-noty-symfony](https://github.com/php-flasher/flasher-noty-symfony) - Symfony Adapter
#### Notyf
- [flasher-notyf](https://github.com/php-flasher/flasher-notyf) - Core Notyf Adapter
- [flasher-notyf-laravel](https://github.com/php-flasher/flasher-notyf-laravel) - Laravel Adapter
- [flasher-notyf-symfony](https://github.com/php-flasher/flasher-notyf-symfony) - Symfony Adapter
#### SweetAlert
- [flasher-sweetalert](https://github.com/php-flasher/flasher-sweetalert) - Core SweetAlert Adapter
- [flasher-sweetalert-laravel](https://github.com/php-flasher/flasher-sweetalert-laravel) - Laravel 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](https://github.com/php-flasher/flasher-toastr).
## 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
class BookController
{
public function saveBook()
{
// Your logic here
flash('Your changes have been saved!');
return redirect()->back();
}
}
```
### Using the `flasher` Service
```php
use Flasher\Prime\FlasherInterface;
class AnotherController
{
/**
* 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.'); // ony for laravel
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']);
```
## Adapters Overview
PHPFlasher supports various adapters to integrate seamlessly with different frameworks and frontend libraries. Below is an overview of available adapters:
| Adapter Repository | Description |
|-----------------------------------------------------------------------------------------|--------------------------------|
| [flasher-laravel](https://github.com/php-flasher/flasher-laravel) | Laravel framework adapter |
| [flasher-symfony](https://github.com/php-flasher/flasher-symfony) | Symfony framework adapter |
| [flasher-toastr-laravel](https://github.com/php-flasher/flasher-toastr-laravel) | Toastr adapter for Laravel |
| [flasher-toastr-symfony](https://github.com/php-flasher/flasher-toastr-symfony) | Toastr adapter for Symfony |
| [flasher-noty-laravel](https://github.com/php-flasher/flasher-noty-laravel) | Noty adapter for Laravel |
| [flasher-noty-symfony](https://github.com/php-flasher/flasher-noty-symfony) | Noty adapter for Symfony |
| [flasher-notyf-laravel](https://github.com/php-flasher/flasher-notyf-laravel) | Notyf adapter for Laravel |
| [flasher-notyf-symfony](https://github.com/php-flasher/flasher-notyf-symfony) | Notyf adapter for Symfony |
| [flasher-sweetalert-laravel](https://github.com/php-flasher/flasher-sweetalert-laravel) | SweetAlert adapter for Laravel |
| [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
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io).
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
@@ -53,6 +254,7 @@ Shining stars of our community:
<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>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/BrookeDot"><img src="https://avatars.githubusercontent.com/u/150348?v=4?s=100" width="100px;" alt="Brooke."/><br /><sub><b>Brooke.</b></sub></a><br /><a href="https://github.com/php-flasher/php-flasher/commits?author=BrookeDot" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
Executable
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -e
NPM_FOLDERS=(
"src/Prime/Resources"
"src/Noty/Prime/Resources"
"src/Notyf/Prime/Resources"
"src/SweetAlert/Prime/Resources"
"src/Toastr/Prime/Resources"
)
for folder in "${NPM_FOLDERS[@]}"; do
if [ -d "$folder" ]; then
echo ""
echo "Publishing $folder to npm..."
(
cd "$folder"
npm install
npm version "$VERSION" --no-git-tag-version || true
npm publish --access public
)
fi
done
echo "Release $VERSION complete tagged repositories and published packages to npm."
+3 -3
View File
@@ -22,9 +22,9 @@
"require": {
"php": ">=8.2",
"ext-intl": "*",
"illuminate/contracts": "^11.0",
"illuminate/routing": "^11.0",
"illuminate/support": "^11.0",
"illuminate/contracts": "^11.0|^12.0",
"illuminate/routing": "^11.0|^12.0",
"illuminate/support": "^11.0|^12.0",
"laravel/octane": "^2.3",
"livewire/livewire": "^3.0",
"paragonie/random_compat": "^2.0",
Generated
+136 -136
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ddb7aadf973fbf84a14d002bdfa9c226",
"content-hash": "9847ba2abb14c12d2e0b0d55e8251f79",
"packages": [
{
"name": "brick/math",
@@ -1057,8 +1057,8 @@
"type": "library",
"extra": {
"laminas": {
"config-provider": "Laminas\\Diactoros\\ConfigProvider",
"module": "Laminas\\Diactoros"
"module": "Laminas\\Diactoros",
"config-provider": "Laminas\\Diactoros\\ConfigProvider"
}
},
"autoload": {
@@ -1357,16 +1357,16 @@
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
},
"laravel": {
"providers": [
"Laravel\\Octane\\OctaneServiceProvider"
],
"aliases": {
"Octane": "Laravel\\Octane\\Facades\\Octane"
}
},
"providers": [
"Laravel\\Octane\\OctaneServiceProvider"
]
},
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
@@ -1883,12 +1883,12 @@
"type": "library",
"extra": {
"laravel": {
"providers": [
"Livewire\\LivewireServiceProvider"
],
"aliases": {
"Livewire": "Livewire\\Livewire"
}
},
"providers": [
"Livewire\\LivewireServiceProvider"
]
}
},
"autoload": {
@@ -2030,12 +2030,12 @@
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"url": "https://github.com/CarbonPHP/carbon.git",
"reference": "7ae1c6fd10d2a93a0a0f5ab8fc8be37cb0830dec"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7ae1c6fd10d2a93a0a0f5ab8fc8be37cb0830dec",
"url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/7ae1c6fd10d2a93a0a0f5ab8fc8be37cb0830dec",
"reference": "7ae1c6fd10d2a93a0a0f5ab8fc8be37cb0830dec",
"shasum": ""
},
@@ -2068,10 +2068,6 @@
],
"type": "library",
"extra": {
"branch-alias": {
"dev-3.x": "3.x-dev",
"dev-master": "2.x-dev"
},
"laravel": {
"providers": [
"Carbon\\Laravel\\ServiceProvider"
@@ -2081,6 +2077,10 @@
"includes": [
"extension.neon"
]
},
"branch-alias": {
"dev-3.x": "3.x-dev",
"dev-master": "2.x-dev"
}
},
"autoload": {
@@ -3162,31 +3162,31 @@
},
{
"name": "symfony/cache",
"version": "v7.0.0",
"version": "v6.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache.git",
"reference": "5e2376f726d61541b9617512e374808d12c1dc22"
"reference": "ac2d25f97b17eec6e19760b6b9962a4f7c44356a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/cache/zipball/5e2376f726d61541b9617512e374808d12c1dc22",
"reference": "5e2376f726d61541b9617512e374808d12c1dc22",
"url": "https://api.github.com/repos/symfony/cache/zipball/ac2d25f97b17eec6e19760b6b9962a4f7c44356a",
"reference": "ac2d25f97b17eec6e19760b6b9962a4f7c44356a",
"shasum": ""
},
"require": {
"php": ">=8.2",
"php": ">=8.1",
"psr/cache": "^2.0|^3.0",
"psr/log": "^1.1|^2|^3",
"symfony/cache-contracts": "^2.5|^3",
"symfony/service-contracts": "^2.5|^3",
"symfony/var-exporter": "^6.4|^7.0"
"symfony/var-exporter": "^6.3.6|^7.0"
},
"conflict": {
"doctrine/dbal": "<3.6",
"symfony/dependency-injection": "<6.4",
"symfony/http-kernel": "<6.4",
"symfony/var-dumper": "<6.4"
"doctrine/dbal": "<2.13.1",
"symfony/dependency-injection": "<5.4",
"symfony/http-kernel": "<5.4",
"symfony/var-dumper": "<5.4"
},
"provide": {
"psr/cache-implementation": "2.0|3.0",
@@ -3195,15 +3195,15 @@
},
"require-dev": {
"cache/integration-tests": "dev-master",
"doctrine/dbal": "^3.6|^4",
"doctrine/dbal": "^2.13.1|^3|^4",
"predis/predis": "^1.1|^2.0",
"psr/simple-cache": "^1.0|^2.0|^3.0",
"symfony/config": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/filesystem": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
"symfony/messenger": "^6.4|^7.0",
"symfony/var-dumper": "^6.4|^7.0"
"symfony/config": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/filesystem": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
"symfony/messenger": "^5.4|^6.0|^7.0",
"symfony/var-dumper": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -3238,7 +3238,7 @@
"psr6"
],
"support": {
"source": "https://github.com/symfony/cache/tree/v7.0.0"
"source": "https://github.com/symfony/cache/tree/v6.4.0"
},
"funding": [
{
@@ -3254,7 +3254,7 @@
"type": "tidelift"
}
],
"time": "2023-11-25T15:40:35+00:00"
"time": "2023-11-24T19:28:07+00:00"
},
{
"name": "symfony/cache-contracts",
@@ -3279,12 +3279,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -3732,12 +3732,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -3857,24 +3857,24 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v7.0.0",
"version": "v6.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e"
"reference": "d76d2632cfc2206eecb5ad2b26cd5934082941b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c459b40ffe67c49af6fd392aac374c9edf8a027e",
"reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d76d2632cfc2206eecb5ad2b26cd5934082941b6",
"reference": "d76d2632cfc2206eecb5ad2b26cd5934082941b6",
"shasum": ""
},
"require": {
"php": ">=8.2",
"php": ">=8.1",
"symfony/event-dispatcher-contracts": "^2.5|^3"
},
"conflict": {
"symfony/dependency-injection": "<6.4",
"symfony/dependency-injection": "<5.4",
"symfony/service-contracts": "<2.5"
},
"provide": {
@@ -3883,13 +3883,13 @@
},
"require-dev": {
"psr/log": "^1|^2|^3",
"symfony/config": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/error-handler": "^6.4|^7.0",
"symfony/expression-language": "^6.4|^7.0",
"symfony/http-foundation": "^6.4|^7.0",
"symfony/config": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/error-handler": "^5.4|^6.0|^7.0",
"symfony/expression-language": "^5.4|^6.0|^7.0",
"symfony/http-foundation": "^5.4|^6.0|^7.0",
"symfony/service-contracts": "^2.5|^3",
"symfony/stopwatch": "^6.4|^7.0"
"symfony/stopwatch": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -3917,7 +3917,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/event-dispatcher/tree/v7.0.0"
"source": "https://github.com/symfony/event-dispatcher/tree/v6.4.0"
},
"funding": [
{
@@ -3933,7 +3933,7 @@
"type": "tidelift"
}
],
"time": "2023-07-27T16:29:09+00:00"
"time": "2023-07-27T06:52:43+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
@@ -3958,12 +3958,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -4661,12 +4661,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
},
"branch-alias": {
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -4942,12 +4942,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
},
"branch-alias": {
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -5077,12 +5077,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
},
"branch-alias": {
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -5160,12 +5160,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
},
"branch-alias": {
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -5240,12 +5240,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
},
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -5784,12 +5784,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "3.4-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -6045,12 +6045,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -6407,8 +6407,8 @@
"type": "symfony-bundle",
"extra": {
"thanks": {
"name": "symfony/ux",
"url": "https://github.com/symfony/ux"
"url": "https://github.com/symfony/ux",
"name": "symfony/ux"
}
},
"autoload": {
@@ -7252,13 +7252,13 @@
},
"type": "phpstan-extension",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
},
"phpstan": {
"includes": [
"extension.neon"
]
},
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
@@ -7712,13 +7712,13 @@
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "9.0-dev"
},
"laravel": {
"providers": [
"Orchestra\\Canvas\\LaravelServiceProvider"
]
},
"branch-alias": {
"dev-master": "9.0-dev"
}
},
"autoload": {
@@ -7780,13 +7780,13 @@
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "9.0-dev"
},
"laravel": {
"providers": [
"Orchestra\\Canvas\\Core\\LaravelServiceProvider"
]
},
"branch-alias": {
"dev-master": "9.0-dev"
}
},
"autoload": {
@@ -8028,16 +8028,16 @@
},
{
"name": "overtrue/phplint",
"version": "9.5.3",
"version": "9.5.6",
"source": {
"type": "git",
"url": "https://github.com/overtrue/phplint.git",
"reference": "584063a687abca041551e0b14c47fe9fc574b193"
"reference": "3fdc395a816d1401091062c7a3bfb31252aed6c5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/overtrue/phplint/zipball/584063a687abca041551e0b14c47fe9fc574b193",
"reference": "584063a687abca041551e0b14c47fe9fc574b193",
"url": "https://api.github.com/repos/overtrue/phplint/zipball/3fdc395a816d1401091062c7a3bfb31252aed6c5",
"reference": "3fdc395a816d1401091062c7a3bfb31252aed6c5",
"shasum": ""
},
"require": {
@@ -8045,14 +8045,14 @@
"ext-dom": "*",
"ext-json": "*",
"ext-mbstring": "*",
"php": "^8.2",
"symfony/cache": "^7.0",
"symfony/console": "^7.0",
"symfony/event-dispatcher": "^7.0",
"symfony/finder": "^7.0",
"symfony/options-resolver": "^7.0",
"symfony/process": "^7.0",
"symfony/yaml": "^7.0"
"php": "^8.1",
"symfony/cache": "^6.4 || ^7.0",
"symfony/console": "^6.4 || ^7.0",
"symfony/event-dispatcher": "^6.4 || ^7.0",
"symfony/finder": "^6.4 || ^7.0",
"symfony/options-resolver": "^6.4 || ^7.0",
"symfony/process": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4",
@@ -8065,17 +8065,17 @@
],
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"target-directory": "vendor-bin",
"forward-command": true
},
"hooks": {
"pre-commit": [
"composer style:fix",
"composer code:check"
]
},
"bamarni-bin": {
"bin-links": true,
"forward-command": true,
"target-directory": "vendor-bin"
},
"branch-alias": {
"dev-main": "9.5.x-dev"
}
@@ -8109,7 +8109,7 @@
],
"support": {
"issues": "https://github.com/overtrue/phplint/issues",
"source": "https://github.com/overtrue/phplint/tree/9.5.3"
"source": "https://github.com/overtrue/phplint/tree/9.5.6"
},
"funding": [
{
@@ -8117,7 +8117,7 @@
"type": "github"
}
],
"time": "2024-10-11T07:13:25+00:00"
"time": "2025-01-15T05:41:15+00:00"
},
{
"name": "phar-io/manifest",
@@ -9060,12 +9060,12 @@
],
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "0.12.x-dev"
},
"bamarni-bin": {
"bin-links": false,
"forward-command": false
},
"branch-alias": {
"dev-main": "0.12.x-dev"
}
},
"autoload": {
@@ -10213,13 +10213,13 @@
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.29.x-dev"
},
"laravel": {
"providers": [
"Spatie\\LaravelRay\\RayServiceProvider"
]
},
"branch-alias": {
"dev-main": "1.29.x-dev"
}
},
"autoload": {
@@ -10398,20 +10398,20 @@
},
{
"name": "symfony/options-resolver",
"version": "v7.0.0",
"version": "v6.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "700ff4096e346f54cb628ea650767c8130f1001f"
"reference": "22301f0e7fdeaacc14318928612dee79be99860e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f",
"reference": "700ff4096e346f54cb628ea650767c8130f1001f",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/22301f0e7fdeaacc14318928612dee79be99860e",
"reference": "22301f0e7fdeaacc14318928612dee79be99860e",
"shasum": ""
},
"require": {
"php": ">=8.2",
"php": ">=8.1",
"symfony/deprecation-contracts": "^2.5|^3"
},
"type": "library",
@@ -10445,7 +10445,7 @@
"options"
],
"support": {
"source": "https://github.com/symfony/options-resolver/tree/v7.0.0"
"source": "https://github.com/symfony/options-resolver/tree/v6.4.0"
},
"funding": [
{
@@ -10461,7 +10461,7 @@
"type": "tidelift"
}
],
"time": "2023-08-08T10:20:21+00:00"
"time": "2023-08-08T10:16:24+00:00"
},
{
"name": "symfony/polyfill-iconv",
+64
View File
@@ -0,0 +1,64 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:mNtM4UEOfGE4dx7IAH4+kx4iPYPdGeu+Gaw/PIcF4II=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
BCRYPT_ROUNDS=12
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
CACHE_STORE=database
CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=log
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}"
-1
View File
@@ -6,7 +6,6 @@
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
+17 -17
View File
@@ -15,26 +15,26 @@
],
"require": {
"php": "^8.2",
"inertiajs/inertia-laravel": "^1.0",
"laravel/framework": "^11.0",
"laravel/tinker": "^2.9",
"livewire/livewire": "^3.4",
"inertiajs/inertia-laravel": "^2.0.1",
"laravel/framework": "^11.43.2",
"laravel/tinker": "^2.10.1",
"livewire/livewire": "^3.5.20",
"php-flasher/php-flasher": "@dev",
"spatie/laravel-csp": "^2.9",
"spatie/laravel-ray": "^1.36"
"spatie/laravel-csp": "^2.10.3",
"spatie/laravel-ray": "^1.39.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.14",
"fakerphp/faker": "^1.23",
"larastan/larastan": "^2.9",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.0",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-laravel": "^2.3",
"spatie/laravel-ignition": "^2.4",
"spatie/ray": "^1.41"
"barryvdh/laravel-debugbar": "^3.15",
"fakerphp/faker": "^1.24.1",
"larastan/larastan": "^3.1",
"laravel/pint": "^1.21",
"laravel/sail": "^1.41",
"mockery/mockery": "^1.6.12",
"nunomaduro/collision": "^8.6.1",
"pestphp/pest": "^3.7.4",
"pestphp/pest-plugin-laravel": "^3.1",
"spatie/laravel-ignition": "^2.9.1",
"spatie/ray": "^1.41.5"
},
"autoload": {
"psr-4": {
+1863 -1525
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -18,3 +18,7 @@
APP_ENV=dev
APP_SECRET=a2ee898b9e385a80ba8f7b11e97232b2
###< symfony/framework-bundle ###
###> symfony/mailer ###
MAILER_DSN=null://null
###< symfony/mailer ###
+1
View File
@@ -0,0 +1 @@
8.2
+1
View File
@@ -0,0 +1 @@
php=php@8.2
+21 -20
View File
@@ -16,21 +16,27 @@
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"nelmio/security-bundle": "^3.3",
"nelmio/security-bundle": "^3.4.2",
"php-flasher/php-flasher": "@dev",
"phpstan/phpstan-symfony": "^1.3",
"symfony/console": "7.0.*",
"symfony/dotenv": "7.0.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "7.0.*",
"phpstan/phpstan-symfony": "^2.0.2",
"symfony/console": "7.2.*",
"symfony/dotenv": "7.2.*",
"symfony/flex": "^2.4.7",
"symfony/framework-bundle": "7.2.*",
"symfony/monolog-bundle": "^3.10",
"symfony/notifier": "7.0.*",
"symfony/runtime": "7.0.*",
"symfony/translation": "7.0.*",
"symfony/twig-bundle": "7.0.*",
"symfony/yaml": "7.0.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
"symfony/notifier": "7.2.*",
"symfony/runtime": "7.2.*",
"symfony/translation": "7.2.*",
"symfony/twig-bundle": "7.2.*",
"symfony/yaml": "7.2.*",
"twig/extra-bundle": "^2.12|^3.20",
"twig/twig": "^2.12|^3.20"
},
"require-dev": {
"spatie/ray": "^1.41.5",
"symfony/maker-bundle": "^1.62.1",
"symfony/stopwatch": "7.2.*",
"symfony/web-profiler-bundle": "7.2.*"
},
"config": {
"allow-plugins": {
@@ -79,13 +85,8 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "7.0.*"
"require": "7.2.*",
"docker": false
}
},
"require-dev": {
"spatie/ray": "^1.41",
"symfony/maker-bundle": "^1.58",
"symfony/stopwatch": "7.0.*",
"symfony/web-profiler-bundle": "7.0.*"
}
}
+7720 -3831
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -13,4 +13,5 @@ return [
Nelmio\SecurityBundle\NelmioSecurityBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
];
+3
View File
@@ -0,0 +1,3 @@
framework:
mailer:
dsn: '%env(MAILER_DSN)%'
@@ -0,0 +1,5 @@
twig_component:
anonymous_template_directory: 'components/'
defaults:
# Namespace & directory for components
App\Twig\Components\: 'components/'
@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@flasher/flasher"),require("noty")):"function"==typeof define&&define.amd?define(["@flasher/flasher","noty"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Noty=t(e.flasher,e.Noty)}(this,(function(e,t){"use strict";class s{success(e,t,s){this.flash("success",e,t,s)}error(e,t,s){this.flash("error",e,t,s)}info(e,t,s){this.flash("info",e,t,s)}warning(e,t,s){this.flash("warning",e,t,s)}flash(e,t,s,o){if("object"==typeof e?(e=(o=e).type,t=o.message,s=o.title):"object"==typeof t?(t=(o=t).message,s=o.title):"object"==typeof s&&(s=(o=s).title),void 0===t)throw new Error("message option is required");const n={type:e,message:t,title:s||e,options:o||{},metadata:{plugin:""}};this.renderOptions(o||{}),this.renderEnvelopes([n])}}const o=new class extends s{renderEnvelopes(e){e.forEach((e=>{var s;const o=Object.assign({text:e.message,type:e.type},e.options),n=new t(o);n.show(),null===(s=n.layoutDom)||void 0===s||(s.dataset.turboTemporary="")}))}renderOptions(e){t.overrideDefaults(Object.assign({timeout:e.timeout||5e3},e))}};return e.addPlugin("noty",o),o}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@flasher/flasher"),require("sweetalert2")):"function"==typeof define&&define.amd?define(["@flasher/flasher","sweetalert2"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).sweetalert=t(e.flasher,e.Swal)}(this,(function(e,t){"use strict";function s(e,t,s,n){return new(s||(s=Promise))((function(i,r){function o(e){try{a(n.next(e))}catch(e){r(e)}}function l(e){try{a(n.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,l)}a((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class n{success(e,t,s){this.flash("success",e,t,s)}error(e,t,s){this.flash("error",e,t,s)}info(e,t,s){this.flash("info",e,t,s)}warning(e,t,s){this.flash("warning",e,t,s)}flash(e,t,s,n){if("object"==typeof e?(e=(n=e).type,t=n.message,s=n.title):"object"==typeof t?(t=(n=t).message,s=n.title):"object"==typeof s&&(s=(n=s).title),void 0===t)throw new Error("message option is required");const i={type:e,message:t,title:s||e,options:n||{},metadata:{plugin:""}};this.renderOptions(n||{}),this.renderEnvelopes([i])}}const i=new class extends n{renderEnvelopes(e){return s(this,void 0,void 0,(function*(){for(const t of e)yield this.renderEnvelope(t)}))}renderOptions(e){this.sweetalert=this.sweetalert||t.mixin(Object.assign({timer:e.timer||5e3,timerProgressBar:e.timerProgressBar||!0},e)),document.addEventListener("turbo:before-cache",(()=>{var e;t.isVisible()&&(null===(e=t.getPopup())||void 0===e||e.style.setProperty("animation-duration","0ms"),t.close())}))}renderEnvelope(e){return s(this,void 0,void 0,(function*(){var t;let{options:s}=e;s=Object.assign(Object.assign({},s),{icon:(null==s?void 0:s.icon)||e.type,text:(null==s?void 0:s.text)||e.message}),yield null===(t=this.sweetalert)||void 0===t?void 0:t.fire(s).then((t=>{window.dispatchEvent(new CustomEvent("flasher:sweetalert:promise",{detail:{promise:t,envelope:e}}))}))}))}};return e.addPlugin("sweetalert",i),i}));
@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@flasher/flasher"),require("toastr")):"function"==typeof define&&define.amd?define(["@flasher/flasher","toastr"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).toastr=t(e.flasher,e.toastr)}(this,(function(e,t){"use strict";class s{success(e,t,s){this.flash("success",e,t,s)}error(e,t,s){this.flash("error",e,t,s)}info(e,t,s){this.flash("info",e,t,s)}warning(e,t,s){this.flash("warning",e,t,s)}flash(e,t,s,r){if("object"==typeof e?(e=(r=e).type,t=r.message,s=r.title):"object"==typeof t?(t=(r=t).message,s=r.title):"object"==typeof s&&(s=(r=s).title),void 0===t)throw new Error("message option is required");const o={type:e,message:t,title:s||e,options:r||{},metadata:{plugin:""}};this.renderOptions(r||{}),this.renderEnvelopes([o])}}const r=new class extends s{renderEnvelopes(e){e.forEach((e=>{const{message:s,title:r,type:o,options:i}=e,n=t[o](s,r,i);n&&n.parent().attr("data-turbo-temporary","")}))}renderOptions(e){t.options=Object.assign({timeOut:e.timeOut||5e3,progressBar:e.progressBar||!0},e)}};return e.addPlugin("toastr",r),r}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+17
View File
@@ -0,0 +1,17 @@
{
"/vendor/flasher/flasher.min.js": "/vendor/flasher/flasher.min.js?id=9a255a6680873c0d5fc3d394a2ba3195",
"/vendor/flasher/flasher.min.css": "/vendor/flasher/flasher.min.css?id=7a96e40c68626198d5128ad2fb5d77e0",
"/vendor/flasher/mint.css": "/vendor/flasher/mint.css?id=348f135fff639305dde0005c647c1d20",
"/vendor/flasher/flasher-noty.min.js": "/vendor/flasher/flasher-noty.min.js?id=d7d160fe2043e65250dfcaa5590d2e28",
"/vendor/flasher/noty.css": "/vendor/flasher/noty.css?id=bf51111a785e04cc8c86a7786e855484",
"/vendor/flasher/noty.min.js": "/vendor/flasher/noty.min.js?id=840a31ddb720ff391cfc386c009d3422",
"/vendor/flasher/flasher-notyf.min.js": "/vendor/flasher/flasher-notyf.min.js?id=d8778adb84f0e2521d413c9ca995309c",
"/vendor/flasher/flasher-notyf.min.css": "/vendor/flasher/flasher-notyf.min.css?id=53f57ecf59a7045f8029243bde3ed054",
"/vendor/flasher/toastr.min.css": "/vendor/flasher/toastr.min.css?id=f284028c678041d687c6f1be6968f68a",
"/vendor/flasher/flasher-toastr.min.js": "/vendor/flasher/flasher-toastr.min.js?id=e0d38991a82d544068555ff7c2a2339b",
"/vendor/flasher/toastr.min.js": "/vendor/flasher/toastr.min.js?id=8ee1218b09fb02d43fcf0b84e30637ad",
"/vendor/flasher/jquery.min.js": "/vendor/flasher/jquery.min.js?id=2c872dbe60f4ba70fb85356113d8b35e",
"/vendor/flasher/sweetalert2.min.js": "/vendor/flasher/sweetalert2.min.js?id=52e4f161dbe2cf71c99dfef9f94fb1ff",
"/vendor/flasher/sweetalert2.min.css": "/vendor/flasher/sweetalert2.min.css?id=a45abfe01a51ef4b1a068fb739f4e540",
"/vendor/flasher/flasher-sweetalert.min.js": "/vendor/flasher/flasher-sweetalert.min.js?id=4ede7e66493a3432961bb00ce83dd4da"
}
+37
View File
@@ -0,0 +1,37 @@
.noty_theme__mint.noty_bar {
margin: 4px 0;
overflow: hidden;
border-radius: 2px;
position: relative; }
.noty_theme__mint.noty_bar .noty_body {
padding: 10px;
font-size: 14px; }
.noty_theme__mint.noty_bar .noty_buttons {
padding: 10px; }
.noty_theme__mint.noty_type__alert,
.noty_theme__mint.noty_type__notification {
background-color: #fff;
border-bottom: 1px solid #D1D1D1;
color: #2F2F2F; }
.noty_theme__mint.noty_type__warning {
background-color: #FFAE42;
border-bottom: 1px solid #E89F3C;
color: #fff; }
.noty_theme__mint.noty_type__error {
background-color: #DE636F;
border-bottom: 1px solid #CA5A65;
color: #fff; }
.noty_theme__mint.noty_type__info,
.noty_theme__mint.noty_type__information {
background-color: #7F7EFF;
border-bottom: 1px solid #7473E8;
color: #fff; }
.noty_theme__mint.noty_type__success {
background-color: #AFC765;
border-bottom: 1px solid #A0B55C;
color: #fff; }
+216
View File
@@ -0,0 +1,216 @@
.noty_layout_mixin, #noty_layout__top, #noty_layout__topLeft, #noty_layout__topCenter, #noty_layout__topRight, #noty_layout__bottom, #noty_layout__bottomLeft, #noty_layout__bottomCenter, #noty_layout__bottomRight, #noty_layout__center, #noty_layout__centerLeft, #noty_layout__centerRight {
position: fixed;
margin: 0;
padding: 0;
z-index: 9999999;
-webkit-transform: translateZ(0) scale(1, 1);
transform: translateZ(0) scale(1, 1);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-font-smoothing: subpixel-antialiased;
filter: blur(0);
-webkit-filter: blur(0);
max-width: 90%; }
#noty_layout__top {
top: 0;
left: 5%;
width: 90%; }
#noty_layout__topLeft {
top: 20px;
left: 20px;
width: 325px; }
#noty_layout__topCenter {
top: 5%;
left: 50%;
width: 325px;
-webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1);
transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); }
#noty_layout__topRight {
top: 20px;
right: 20px;
width: 325px; }
#noty_layout__bottom {
bottom: 0;
left: 5%;
width: 90%; }
#noty_layout__bottomLeft {
bottom: 20px;
left: 20px;
width: 325px; }
#noty_layout__bottomCenter {
bottom: 5%;
left: 50%;
width: 325px;
-webkit-transform: translate(-webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1);
transform: translate(calc(-50% - .5px)) translateZ(0) scale(1, 1); }
#noty_layout__bottomRight {
bottom: 20px;
right: 20px;
width: 325px; }
#noty_layout__center {
top: 50%;
left: 50%;
width: 325px;
-webkit-transform: translate(-webkit-calc(-50% - .5px), -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1);
transform: translate(calc(-50% - .5px), calc(-50% - .5px)) translateZ(0) scale(1, 1); }
#noty_layout__centerLeft {
top: 50%;
left: 20px;
width: 325px;
-webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1);
transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); }
#noty_layout__centerRight {
top: 50%;
right: 20px;
width: 325px;
-webkit-transform: translate(0, -webkit-calc(-50% - .5px)) translateZ(0) scale(1, 1);
transform: translate(0, calc(-50% - .5px)) translateZ(0) scale(1, 1); }
.noty_progressbar {
display: none; }
.noty_has_timeout.noty_has_progressbar .noty_progressbar {
display: block;
position: absolute;
left: 0;
bottom: 0;
height: 3px;
width: 100%;
background-color: #646464;
opacity: 0.2;
filter: alpha(opacity=10); }
.noty_bar {
-webkit-backface-visibility: hidden;
-webkit-transform: translate(0, 0) translateZ(0) scale(1, 1);
-ms-transform: translate(0, 0) scale(1, 1);
transform: translate(0, 0) scale(1, 1);
-webkit-font-smoothing: subpixel-antialiased;
overflow: hidden; }
.noty_effects_open {
opacity: 0;
-webkit-transform: translate(50%);
-ms-transform: translate(50%);
transform: translate(50%);
-webkit-animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
animation: noty_anim_in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards; }
.noty_effects_close {
-webkit-animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
animation: noty_anim_out 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards; }
.noty_fix_effects_height {
-webkit-animation: noty_anim_height 75ms ease-out;
animation: noty_anim_height 75ms ease-out; }
.noty_close_with_click {
cursor: pointer; }
.noty_close_button {
position: absolute;
top: 2px;
right: 2px;
font-weight: bold;
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
background-color: rgba(0, 0, 0, 0.05);
border-radius: 2px;
cursor: pointer;
-webkit-transition: all .2s ease-out;
transition: all .2s ease-out; }
.noty_close_button:hover {
background-color: rgba(0, 0, 0, 0.1); }
.noty_modal {
position: fixed;
width: 100%;
height: 100%;
background-color: #000;
z-index: 10000;
opacity: .3;
left: 0;
top: 0; }
.noty_modal.noty_modal_open {
opacity: 0;
-webkit-animation: noty_modal_in .3s ease-out;
animation: noty_modal_in .3s ease-out; }
.noty_modal.noty_modal_close {
-webkit-animation: noty_modal_out .3s ease-out;
animation: noty_modal_out .3s ease-out;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards; }
@-webkit-keyframes noty_modal_in {
100% {
opacity: .3; } }
@keyframes noty_modal_in {
100% {
opacity: .3; } }
@-webkit-keyframes noty_modal_out {
100% {
opacity: 0; } }
@keyframes noty_modal_out {
100% {
opacity: 0; } }
@keyframes noty_modal_out {
100% {
opacity: 0; } }
@-webkit-keyframes noty_anim_in {
100% {
-webkit-transform: translate(0);
transform: translate(0);
opacity: 1; } }
@keyframes noty_anim_in {
100% {
-webkit-transform: translate(0);
transform: translate(0);
opacity: 1; } }
@-webkit-keyframes noty_anim_out {
100% {
-webkit-transform: translate(50%);
transform: translate(50%);
opacity: 0; } }
@keyframes noty_anim_out {
100% {
-webkit-transform: translate(50%);
transform: translate(50%);
opacity: 0; } }
@-webkit-keyframes noty_anim_height {
100% {
height: 0; } }
@keyframes noty_anim_height {
100% {
height: 0; } }
/*# sourceMappingURL=noty.css.map*/
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+33
View File
@@ -66,6 +66,18 @@
"src/Kernel.php"
]
},
"symfony/mailer": {
"version": "7.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "4.3",
"ref": "09051cfde49476e3c12cd3a0e44289ace1c75a4f"
},
"files": [
"config/packages/mailer.yaml"
]
},
"symfony/maker-bundle": {
"version": "1.58",
"recipe": {
@@ -138,6 +150,27 @@
"templates/base.html.twig"
]
},
"symfony/uid": {
"version": "7.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "7.0",
"ref": "0df5844274d871b37fc3816c57a768ffc60a43a5"
}
},
"symfony/ux-twig-component": {
"version": "2.23",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "2.13",
"ref": "67814b5f9794798b885cec9d3f48631424449a01"
},
"files": [
"config/packages/twig_component.yaml"
]
},
"symfony/web-profiler-bundle": {
"version": "7.0",
"recipe": {
+100 -24
View File
@@ -1,27 +1,51 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
base64 (0.2.0)
bigdecimal (3.1.7)
bigdecimal (3.1.9)
colorator (1.1.0)
concurrent-ruby (1.2.3)
csv (3.3.0)
concurrent-ruby (1.3.5)
csv (3.3.2)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.16.3)
ffi (1.17.1)
ffi (1.17.1-aarch64-linux-gnu)
ffi (1.17.1-aarch64-linux-musl)
ffi (1.17.1-arm-linux-gnu)
ffi (1.17.1-arm-linux-musl)
ffi (1.17.1-arm64-darwin)
ffi (1.17.1-x86-linux-gnu)
ffi (1.17.1-x86-linux-musl)
ffi (1.17.1-x86_64-darwin)
ffi (1.17.1-x86_64-linux-gnu)
ffi (1.17.1-x86_64-linux-musl)
forwardable-extended (2.6.0)
google-protobuf (4.26.1)
google-protobuf (4.29.3)
bigdecimal
rake (>= 13)
google-protobuf (4.26.1-x86_64-linux)
google-protobuf (4.29.3-aarch64-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.29.3-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.29.3-x86-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.29.3-x86_64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.29.3-x86_64-linux)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
i18n (1.14.4)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
jekyll (4.3.3)
jekyll (4.3.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
@@ -47,8 +71,8 @@ GEM
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
rexml
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
@@ -58,27 +82,79 @@ GEM
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.5)
public_suffix (6.0.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.2.6)
rouge (4.2.1)
rexml (3.4.0)
rouge (4.5.1)
safe_yaml (1.0.5)
sass-embedded (1.76.0)
google-protobuf (>= 3.25, < 5.0)
rake (>= 13.0.0)
sass-embedded (1.76.0-x86_64-linux-gnu)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.83.4)
google-protobuf (~> 4.29)
rake (>= 13)
sass-embedded (1.83.4-aarch64-linux-android)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-aarch64-linux-gnu)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-aarch64-linux-musl)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-aarch64-mingw-ucrt)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-arm-linux-androideabi)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-arm-linux-gnueabihf)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-arm-linux-musleabihf)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-arm64-darwin)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-riscv64-linux-android)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-riscv64-linux-gnu)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-riscv64-linux-musl)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-x86_64-cygwin)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-x86_64-darwin)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-x86_64-linux-android)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-x86_64-linux-gnu)
google-protobuf (~> 4.29)
sass-embedded (1.83.4-x86_64-linux-musl)
google-protobuf (~> 4.29)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.5.0)
webrick (1.8.1)
unicode-display_width (2.6.0)
webrick (1.9.1)
PLATFORMS
aarch64-linux
aarch64-linux-android
aarch64-linux-gnu
aarch64-linux-musl
aarch64-mingw-ucrt
arm-linux-androideabi
arm-linux-gnu
arm-linux-gnueabihf
arm-linux-musl
arm-linux-musleabihf
arm64-darwin
riscv64-linux-android
riscv64-linux-gnu
riscv64-linux-musl
ruby
x86-linux
x86-linux-gnu
x86-linux-musl
x86_64-cygwin
x86_64-darwin
x86_64-linux
x86_64-linux-android
x86_64-linux-gnu
x86_64-linux-musl
DEPENDENCIES
base64
@@ -92,4 +168,4 @@ DEPENDENCIES
webrick
BUNDLED WITH
2.5.6
2.6.3
+1 -1
View File
@@ -1,5 +1,5 @@
{
"dist/main.css": "/dist/main.6f20ecba.css",
"dist/main.css": "/dist/main.801e5ea3.css",
"dist/main.js": "/dist/main.36e31cce.js",
"dist/455.3a7b4474.css": "/dist/455.3a7b4474.css",
"dist/455.095e6545.js": "/dist/455.095e6545.js",
+1 -1
View File
@@ -99,7 +99,7 @@ flash()->{{ type }}('{{ message }}');
These four methods — `success()`, `error()`, `warning()`, and `info()` — are shortcuts for the `flash()` method. They let you specify the `type` and `message` in one method call instead of passing them separately to `flash()`.
```php
flash()->flash(string $type, string $message, string $title = null, array $options = [])
flash()->flash(string $type, string $message, array $options = [], string $title = null)
```
{% assign id = '#/ usage flash' %}
+1 -1
View File
@@ -2,7 +2,7 @@
"entrypoints": {
"main": {
"css": [
"/dist/main.6f20ecba.css"
"/dist/main.801e5ea3.css"
],
"js": [
"/dist/main.36e31cce.js"
-1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+74 -70
View File
@@ -15,7 +15,7 @@
"@flasher/flasher-sweetalert": "file:../src/SweetAlert/Prime/Resources",
"@flasher/flasher-toastr": "file:../src/Toastr/Prime/Resources",
"@hotwired/stimulus": "^3.2.2",
"@symfony/stimulus-bridge": "^3.2.2",
"@symfony/stimulus-bridge": "^3.2.3",
"@symfony/webpack-encore": "^5.0.1",
"noty": "^3.2.0-beta-deprecated",
"notyf": "^3.10.0",
@@ -29,31 +29,31 @@
"node-ray": "^2.1.2",
"postcss-import": "^16.1.0",
"postcss-loader": "^7.3.4",
"tailwindcss": "^3.4.14",
"tailwindcss": "^3.4.17",
"webpack-notifier": "^1.15.0"
}
},
"../src/Noty/Prime/Resources": {
"name": "@flasher/flasher-noty",
"version": "2.1.0",
"version": "2.1.1",
"license": "MIT",
"peerDependencies": {
"@flasher/flasher": "^2.1.0",
"@flasher/flasher": "^2.1.1",
"noty": "^3.2.0-beta-deprecated"
}
},
"../src/Notyf/Prime/Resources": {
"name": "@flasher/flasher-notyf",
"version": "2.1.0",
"version": "2.1.1",
"license": "MIT",
"peerDependencies": {
"@flasher/flasher": "^2.1.0",
"@flasher/flasher": "^2.1.1",
"notyf": "^3.10.0"
}
},
"../src/Prime/Resources": {
"name": "@flasher/flasher",
"version": "2.1.0",
"version": "2.1.1",
"license": "MIT",
"devDependencies": {
"csstype": "^3.1.3"
@@ -61,22 +61,22 @@
},
"../src/SweetAlert/Prime/Resources": {
"name": "@flasher/flasher-sweetalert",
"version": "2.1.0",
"version": "2.1.1",
"license": "MIT",
"peerDependencies": {
"@flasher/flasher": "^2.1.0",
"@flasher/flasher": "^2.1.1",
"sweetalert2": "^11.6.13"
}
},
"../src/Toastr/Prime/Resources": {
"name": "@flasher/flasher-toastr",
"version": "2.1.0",
"version": "2.1.1",
"license": "MIT",
"devDependencies": {
"@types/toastr": "^2.1.43"
},
"peerDependencies": {
"@flasher/flasher": "^2.1.0",
"@flasher/flasher": "^2.1.1",
"toastr": "^2.1.4"
}
},
@@ -2111,9 +2111,10 @@
"license": "MIT"
},
"node_modules/@symfony/stimulus-bridge": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@symfony/stimulus-bridge/-/stimulus-bridge-3.2.2.tgz",
"integrity": "sha512-kIaUEGPXW7g14zsHkIvQWw8cmfCdXSqsEQx18fuHPBb+R0h8nYPyY+e9uVtTuHlE2wHwAjrJoc6YBBK4a7CpKA==",
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@symfony/stimulus-bridge/-/stimulus-bridge-3.2.3.tgz",
"integrity": "sha512-36rQTihQ2MGOn8EmdOYCr3DQfP3WS1CNcUUXKTPY5ghtFOeb7OVuhbc32AjRowE2/vaVDOUCPOTv3VLf5VtXBA==",
"license": "MIT",
"dependencies": {
"@hotwired/stimulus-webpack-helpers": "^1.0.1",
"@types/webpack-env": "^1.16.4",
@@ -3173,9 +3174,10 @@
}
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"license": "MIT",
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
@@ -4435,10 +4437,11 @@
}
},
"node_modules/jiti": {
"version": "1.21.0",
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz",
"integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==",
"version": "1.21.7",
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz",
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
"devOptional": true,
"license": "MIT",
"bin": {
"jiti": "bin/jiti.js"
}
@@ -4508,9 +4511,9 @@
}
},
"node_modules/lilconfig": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz",
"integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
"integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==",
"license": "MIT",
"engines": {
"node": ">=14"
@@ -4692,15 +4695,16 @@
}
},
"node_modules/nanoid": {
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
"version": "3.3.8",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
"integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
@@ -4968,9 +4972,9 @@
}
},
"node_modules/picocolors": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz",
"integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
"license": "ISC"
},
"node_modules/picomatch": {
@@ -5008,9 +5012,9 @@
}
},
"node_modules/postcss": {
"version": "8.4.38",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz",
"integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==",
"version": "8.5.1",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz",
"integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==",
"funding": [
{
"type": "opencollective",
@@ -5025,10 +5029,11 @@
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.7",
"picocolors": "^1.0.0",
"source-map-js": "^1.2.0"
"nanoid": "^3.3.8",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
},
"engines": {
"node": "^10 || ^12 || >=14"
@@ -5420,20 +5425,27 @@
}
},
"node_modules/postcss-nested": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz",
"integrity": "sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==",
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz",
"integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"postcss-selector-parser": "^6.0.11"
"postcss-selector-parser": "^6.1.1"
},
"engines": {
"node": ">=12.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
"peerDependencies": {
"postcss": "^8.2.14"
}
@@ -6063,9 +6075,10 @@
}
},
"node_modules/source-map-js": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
"integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
}
@@ -6412,34 +6425,34 @@
}
},
"node_modules/tailwindcss": {
"version": "3.4.14",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.14.tgz",
"integrity": "sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA==",
"version": "3.4.17",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz",
"integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==",
"dev": true,
"license": "MIT",
"dependencies": {
"@alloc/quick-lru": "^5.2.0",
"arg": "^5.0.2",
"chokidar": "^3.5.3",
"chokidar": "^3.6.0",
"didyoumean": "^1.2.2",
"dlv": "^1.1.3",
"fast-glob": "^3.3.0",
"fast-glob": "^3.3.2",
"glob-parent": "^6.0.2",
"is-glob": "^4.0.3",
"jiti": "^1.21.0",
"lilconfig": "^2.1.0",
"micromatch": "^4.0.5",
"jiti": "^1.21.6",
"lilconfig": "^3.1.3",
"micromatch": "^4.0.8",
"normalize-path": "^3.0.0",
"object-hash": "^3.0.0",
"picocolors": "^1.0.0",
"postcss": "^8.4.23",
"picocolors": "^1.1.1",
"postcss": "^8.4.47",
"postcss-import": "^15.1.0",
"postcss-js": "^4.0.1",
"postcss-load-config": "^4.0.1",
"postcss-nested": "^6.0.1",
"postcss-selector-parser": "^6.0.11",
"resolve": "^1.22.2",
"sucrase": "^3.32.0"
"postcss-load-config": "^4.0.2",
"postcss-nested": "^6.2.0",
"postcss-selector-parser": "^6.1.2",
"resolve": "^1.22.8",
"sucrase": "^3.35.0"
},
"bin": {
"tailwind": "lib/cli.js",
@@ -6449,15 +6462,6 @@
"node": ">=14.0.0"
}
},
"node_modules/tailwindcss/node_modules/lilconfig": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz",
"integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==",
"dev": true,
"engines": {
"node": ">=10"
}
},
"node_modules/tailwindcss/node_modules/postcss-import": {
"version": "15.1.0",
"resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz",
+2 -2
View File
@@ -16,7 +16,7 @@
"@flasher/flasher-sweetalert": "file:../src/SweetAlert/Prime/Resources",
"@flasher/flasher-toastr": "file:../src/Toastr/Prime/Resources",
"@hotwired/stimulus": "^3.2.2",
"@symfony/stimulus-bridge": "^3.2.2",
"@symfony/stimulus-bridge": "^3.2.3",
"@symfony/webpack-encore": "^5.0.1",
"noty": "^3.2.0-beta-deprecated",
"notyf": "^3.10.0",
@@ -30,7 +30,7 @@
"node-ray": "^2.1.2",
"postcss-import": "^16.1.0",
"postcss-loader": "^7.3.4",
"tailwindcss": "^3.4.14",
"tailwindcss": "^3.4.17",
"webpack-notifier": "^1.15.0"
},
"browserslist": [
+4 -2
View File
@@ -64,8 +64,10 @@ Flash messages are important for interactive applications. **<strong><span class
Start using **<strong><span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span></strong>** with our easy guides:
- [**Symfony Guide**](/Symfony/)
- [**Laravel Guide**](/Laravel/)
- [**Symfony Guide**](/symfony/)
- [**Laravel Guide**](/laravel/)
- [**Livewire Guide**](/livewire/)
- [**Inertia Guide**](/inertia/)
- [**Toastr Library**](/library/toastr/)
- [**Noty Library**](/library/noty/)
- [**Notyf Library**](/library/notyf/)
+1 -1
View File
@@ -9,5 +9,5 @@ return static function (MBConfig $config) {
__DIR__.'/src',
]);
$config->packageAliasFormat('2.x-dev');
// $config->packageAliasFormat('2.x-dev');
};
+721 -665
View File
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -1,7 +1,7 @@
{
"name": "@flasher/php-flasher",
"type": "module",
"version": "2.1.1",
"version": "2.1.5",
"license": "MIT",
"workspaces": [
"src/Prime/Resources",
@@ -19,41 +19,41 @@
},
"devDependencies": {
"@antfu/eslint-config": "^2.27.3",
"@babel/core": "^7.25.8",
"@babel/preset-env": "^7.25.8",
"@babel/core": "^7.26.9",
"@babel/preset-env": "^7.26.9",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.8",
"@rollup/plugin-eslint": "^9.0.5",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-node-resolve": "^15.3.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.16.13",
"@types/node": "^20.17.19",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"all-contributors-cli": "^6.26.1",
"autoprefixer": "^10.4.20",
"browserslist": "^4.24.0",
"browserslist": "^4.24.4",
"cross-env": "^7.0.3",
"cssnano": "^6.1.2",
"eslint": "^8.57.1",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-import-resolver-typescript": "^3.8.3",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-prettier": "^5.2.3",
"postcss-discard-comments": "^6.0.2",
"punycode": "^2.3.1",
"rollup": "^4.24.0",
"rollup": "^4.34.8",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-clear": "^2.0.7",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-progress": "^1.1.2",
"sass": "^1.80.3",
"sass": "^1.85.0",
"ts-node": "^10.9.2",
"tslib": "^2.8.0",
"typescript": "^5.6.3"
"tslib": "^2.8.1",
"typescript": "^5.7.3"
}
}
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+20
View File
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+316 -51
View File
@@ -6,107 +6,370 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo-dark.png">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo.png" alt="PHPFlasher Logo">
</picture>
</p>
# PHPFlasher for Laravel
<p align="center">
<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>
PHPFlasher provides a powerful and intuitive way to add flash notifications to your Laravel applications. With PHPFlasher, you can enhance user feedback efficiently and elegantly.
## Table of Contents
## Official Documentation
- [About PHPFlasher Laravel Adapter](#about-phpflasher-laravel-adapter)
- [Features](#features)
- [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)
For more comprehensive documentation, please visit [PHPFlasher's Official Documentation](https://php-flasher.io).
## About PHPFlasher Laravel Adapter
## Requirements
**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.
- **PHP** v8.2 or higher
- **Laravel** v11.0 or higher
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
To install PHPFlasher for Laravel, use Composer:
### Core Package
Install the PHPFlasher Laravel Adapter via Composer:
```bash
composer require php-flasher/flasher-laravel
```
After installation, publish the assets using:
After installation, set up the necessary assets:
```bash
```shell
php artisan flasher:install
```
## Usage
> **Note:** PHPFlasher automatically injects the necessary JavaScript and CSS assets into your Blade templates. No additional steps are required for asset injection.
Quickly integrate flash notifications in your Laravel project using the simple methods provided by PHPFlasher.
### Adapters
- Display a success message.
PHPFlasher provides various adapters for different notification libraries. Below is an overview of available adapters for Laravel:
```php
flash()->success('Operation completed successfully.');
- [flasher-toastr-laravel](https://github.com/php-flasher/flasher-toastr-laravel) - Laravel Adapter
- [flasher-noty-laravel](https://github.com/php-flasher/flasher-noty-laravel) - Laravel Adapter
- [flasher-notyf-laravel](https://github.com/php-flasher/flasher-notyf-laravel) - Laravel Adapter
- [flasher-sweetalert-laravel](https://github.com/php-flasher/flasher-sweetalert-laravel) - Laravel Adapter
For detailed installation and usage instructions for each adapter, refer to their respective `README.md`.
## Configuration
After installing the PHPFlasher Laravel Adapter, you can configure it by publishing the configuration file or by modifying it directly.
### Configuration File
If you need to customize the default settings, publish the configuration file using the following command:
```bash
php artisan flasher:install --config
```
- Display an error message.
This will create a file at `config/flasher.php` with the following content:
```php
flash()->error('Oops, something went wrong.');
<?php
declare(strict_types=1);
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',
// ],
// ],
]);
```
- Display a warning message.
### 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
flash()->warning('Your account may have been compromised.');
<?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();
}
}
```
- Display an informational message.
### Using the `flasher` Service
```php
flash()->info('This may take some time. Do not refresh the page.');
<?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();
}
}
```
- Set multiple options at once.
## Usage Examples
### Success Message
```php
flash()
->options(['timeout' => 5000, 'position' => 'top-right'])
->success('Your profile has been updated.');
flash()->success('Operation completed successfully!');
```
- Set a single option.
### Error Message
```php
flash()
->option('timer', 5000)
->success('Your reservation has been confirmed.');
flash()->error('An error occurred.');
```
- Set the priority of the message.
### Info Message
```php
flash()
->priority(1)
->success('Your subscription has been activated.');
flash()->info('This is an informational message.');
```
- Set how many requests a message should persist through.
### Warning Message
```php
flash()
->hops(2)
->info('Your account has been created, but requires verification.');
flash()->warning('This is a warning message.');
```
- Translate a message into the specified language.
### Passing Options
```php
flash()
->translate('ar')
->success('Your message has been sent.');
flash()->success('Custom message with options.', ['timeout' => 3000, 'position' => 'bottom-left']);
```
## Contributors
### 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 -->
@@ -124,7 +387,7 @@ flash()
</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>
<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>
@@ -136,15 +399,17 @@ flash()
## Contact
For support, feature requests, or contributions, reach out via:
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 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](mailto:younes.ennaji.pro@gmail.com)
- [Linkedin](https://www.linkedin.com/in/younes--ennaji/)
- [Email me directly](mailto:younes.ennaji.pro@gmail.com)
## License
PHPFlasher is licensed under the [MIT license](https://opensource.org/licenses/MIT).
PHPFlasher is open-sourced software licensed under the [MIT license](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>
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji/">Younes ENNAJI</a> </b> </p>
+2 -2
View File
@@ -28,8 +28,8 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"illuminate/support": "^11.0",
"php-flasher/flasher": "^2.1.1"
"illuminate/support": "^11.0|^12.0",
"php-flasher/flasher": "^2.1.5"
},
"autoload": {
"psr-4": {
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+2 -2
View File
@@ -28,8 +28,8 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher-laravel": "^2.1.1",
"php-flasher/flasher-noty": "^2.1.1"
"php-flasher/flasher-laravel": "^2.1.5",
"php-flasher/flasher-noty": "^2.1.5"
},
"autoload": {
"psr-4": {
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+20
View File
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@flasher/flasher-noty",
"version": "2.1.1",
"version": "2.1.5",
"type": "module",
"license": "MIT",
"main": "dist/flasher-noty.cjs.js",
+1 -1
View File
@@ -33,7 +33,7 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher": "^2.1.1"
"php-flasher/flasher": "^2.1.5"
},
"autoload": {
"psr-4": {
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+2 -2
View File
@@ -28,8 +28,8 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher-noty": "^2.1.1",
"php-flasher/flasher-symfony": "^2.1.1"
"php-flasher/flasher-noty": "^2.1.5",
"php-flasher/flasher-symfony": "^2.1.5"
},
"autoload": {
"psr-4": {
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+2 -2
View File
@@ -29,8 +29,8 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher-laravel": "^2.1.1",
"php-flasher/flasher-notyf": "^2.1.1"
"php-flasher/flasher-laravel": "^2.1.5",
"php-flasher/flasher-notyf": "^2.1.5"
},
"autoload": {
"psr-4": {
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@flasher/flasher-notyf",
"version": "2.1.1",
"version": "2.1.5",
"type": "module",
"license": "MIT",
"main": "dist/flasher-notyf.cjs.js",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -33,7 +33,7 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher": "^2.1.1"
"php-flasher/flasher": "^2.1.5"
},
"autoload": {
"psr-4": {
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+2 -2
View File
@@ -29,8 +29,8 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher-notyf": "^2.1.1",
"php-flasher/flasher-symfony": "^2.1.1"
"php-flasher/flasher-notyf": "^2.1.5",
"php-flasher/flasher-symfony": "^2.1.5"
},
"autoload": {
"psr-4": {
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+20
View File
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+1 -1
View File
@@ -15,7 +15,7 @@ final readonly class Flasher implements FlasherInterface
{
use ForwardsCalls;
public const VERSION = '2.1.1';
public const VERSION = '2.1.5';
public function __construct(
private string $default,
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@flasher/flasher",
"version": "2.1.1",
"version": "2.1.5",
"type": "module",
"license": "MIT",
"main": "dist/flasher.cjs.js",
File diff suppressed because one or more lines are too long
@@ -27,14 +27,16 @@ final readonly class ResourceManager implements ResourceManagerInterface
public function __construct(
private TemplateEngineInterface $templateEngine,
private AssetManagerInterface $assetManager,
private string $mainScript,
private array $resources,
private ?string $mainScript = null,
private array $resources = [],
) {
}
public function populateResponse(Response $response): Response
{
$response->setMainScript($this->assetManager->getPath($this->mainScript));
if (null !== $this->mainScript) {
$response->setMainScript($this->assetManager->getPath($this->mainScript));
}
$plugins = [];
foreach ($response->getEnvelopes() as $envelope) {
-7
View File
@@ -41,12 +41,5 @@
"config": {
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"phpstan": {
"includes": [
"extension.neon"
]
}
}
}
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+2 -2
View File
@@ -30,8 +30,8 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher-laravel": "^2.1.1",
"php-flasher/flasher-sweetalert": "^2.1.1"
"php-flasher/flasher-laravel": "^2.1.5",
"php-flasher/flasher-sweetalert": "^2.1.5"
},
"autoload": {
"psr-4": {
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@flasher/flasher-sweetalert",
"version": "2.1.1",
"version": "2.1.5",
"type": "module",
"license": "MIT",
"main": "dist/flasher-sweetalert.cjs.js",
+1 -1
View File
@@ -33,7 +33,7 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher": "^2.1.1"
"php-flasher/flasher": "^2.1.5"
},
"autoload": {
"psr-4": {
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+2 -2
View File
@@ -30,8 +30,8 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher-sweetalert": "^2.1.1",
"php-flasher/flasher-symfony": "^2.1.1"
"php-flasher/flasher-sweetalert": "^2.1.5",
"php-flasher/flasher-symfony": "^2.1.5"
},
"autoload": {
"psr-4": {
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+20
View File
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
+330 -16
View File
@@ -6,26 +6,340 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github-dark.png">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-github.png" alt="PHPFlasher Logo">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo-dark.png">
<img src="https://raw.githubusercontent.com/php-flasher/art/main/php-flasher-logo.png" alt="PHPFlasher Logo">
</picture>
</p>
## About PHPFlasher
<p align="center">
<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>
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.
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.
## Table of Contents
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.
This improves user engagement and enhances the overall user experience on your website or application.
- [About PHPFlasher Symfony Adapter](#about-phpflasher-symfony-adapter)
- [Features](#features)
- [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)
Whether you're a beginner or an experienced developer, PHPFlasher's intuitive and straightforward design makes it easy to integrate into your projects.
So, if you're looking for a reliable, flexible and easy to use flash messages solution, PHPFlasher is the perfect choice.
## 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
### Core Package
Install the PHPFlasher Symfony Adapter via Composer:
```bash
composer require php-flasher/flasher-symfony
```
After installation, set up the necessary assets:
```shell
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.
### Adapters
PHPFlasher provides various adapters for different notification libraries. Below is an overview of available adapters for Symfony:
- [flasher-toastr-symfony](https://github.com/php-flasher/flasher-toastr-symfony) - Symfony Adapter
- [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`.
## Configuration
After installing the PHPFlasher Symfony Adapter, you can configure it by publishing the configuration file or by modifying it directly.
### Configuration File
If you need to customize the default settings, publish the configuration file using the following command:
```bash
php bin/console flasher:install --config
```
This will create a file at `config/packages/flasher.yaml` with the following content:
```yaml
flasher:
# 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:
# # 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
Documentation for PHPFlasher can be found on the [https://php-flasher.io](https://php-flasher.io).
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
@@ -42,7 +356,7 @@ Shining stars of our community:
<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://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>
@@ -52,7 +366,7 @@ Shining stars of our community:
</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>
<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>
@@ -64,17 +378,17 @@ Shining stars of our community:
## Contact
PHPFlasher is being actively developed by <a href="https://github.com/yoeunes">yoeunes</a>.
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 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//)
- [Linkedin](https://www.linkedin.com/in/younes--ennaji/)
- [Email me directly](mailto:younes.ennaji.pro@gmail.com)
## License
PHPFlasher is open-sourced software licensed under the [MIT license](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>
<p align="center"> <b>Made with ❤️ by <a href="https://www.linkedin.com/in/younes--ennaji/">Younes ENNAJI</a> </b> </p>
+1 -1
View File
@@ -28,7 +28,7 @@
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php-flasher/flasher": "^2.1.1",
"php-flasher/flasher": "^2.1.5",
"symfony/config": "^7.0",
"symfony/console": "^7.0",
"symfony/dependency-injection": "^7.0",
+8
View File
@@ -0,0 +1,8 @@
Please do not submit any Pull Requests here. They will be closed.
---
Please submit your PR here instead:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!
@@ -0,0 +1,20 @@
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: |
Thanks for your Pull Request! We love contributions.
However, you should instead open your PR on the main repository:
https://github.com/php-flasher/php-flasher
This repository is what we call a "subtree split": a read-only subset of that main repository.
We're looking forward to your PR there!

Some files were not shown because too many files have changed in this diff Show More