first commit
This commit is contained in:
55
vendor/yoeunes/toastr/.github/CONTRIBUTING.md
vendored
Normal file
55
vendor/yoeunes/toastr/.github/CONTRIBUTING.md
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
# Contributing
|
||||
|
||||
Contributions are **welcome** and will be fully **credited**.
|
||||
|
||||
Please read and understand the contribution guide before creating an issue or pull request.
|
||||
|
||||
## Etiquette
|
||||
|
||||
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
|
||||
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
|
||||
extremely unfair for them to suffer abuse or anger for their hard work.
|
||||
|
||||
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
|
||||
world that developers are civilized and selfless people.
|
||||
|
||||
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
|
||||
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
|
||||
|
||||
## Viability
|
||||
|
||||
When requesting or submitting new features, first consider whether it might be useful to others. Open
|
||||
source projects are used by many developers, who may have entirely different needs to your own. Think about
|
||||
whether or not your feature is likely to be used by other users of the project.
|
||||
|
||||
## Procedure
|
||||
|
||||
Before filing an issue:
|
||||
|
||||
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
|
||||
- Check to make sure your feature suggestion isn't already present within the project.
|
||||
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
|
||||
- Check the pull requests tab to ensure that the feature isn't already in progress.
|
||||
|
||||
Before submitting a pull request:
|
||||
|
||||
- Check the codebase to ensure that your feature doesn't already exist.
|
||||
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
|
||||
|
||||
## Requirements
|
||||
|
||||
If the project maintainer has any additional requirements, you will find them listed here.
|
||||
|
||||
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).
|
||||
|
||||
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
|
||||
|
||||
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
|
||||
|
||||
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
|
||||
|
||||
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
|
||||
|
||||
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
|
||||
|
||||
**Happy coding**!
|
5
vendor/yoeunes/toastr/.github/FUNDING.yml
vendored
Normal file
5
vendor/yoeunes/toastr/.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
github: yoeunes
|
||||
patreon: yoeunes
|
||||
ko_fi: yoeunes
|
||||
open_collective: php-flasher
|
||||
custom: https://www.paypal.com/paypalme/yoeunes
|
48
vendor/yoeunes/toastr/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
48
vendor/yoeunes/toastr/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. Windows 10, iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Severity**
|
||||
- [ ] High
|
||||
- [ ] Medium
|
||||
- [ ] Low
|
||||
|
||||
**Related Issues**
|
||||
- #<NUMBER>
|
||||
|
||||
**Additional context**
|
||||
- Provide version of the yoeunes/toastr.
|
||||
- Provide the error log or any other relevant debugging information.
|
||||
- Add any other context about the problem here.
|
33
vendor/yoeunes/toastr/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
33
vendor/yoeunes/toastr/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe the benefit of the solution**
|
||||
A clear and concise description of the benefit of the solution.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered and why they are not suitable.
|
||||
|
||||
**User Impact**
|
||||
- [ ] High
|
||||
- [ ] Medium
|
||||
- [ ] Low
|
||||
|
||||
**Related Issues**
|
||||
- #<NUMBER>
|
||||
|
||||
**Additional context**
|
||||
- Provide examples of how the feature will be used in the real world.
|
||||
- Provide any relevant user stories or use cases.
|
||||
- Add any other context or screenshots about the feature request here.
|
23
vendor/yoeunes/toastr/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
23
vendor/yoeunes/toastr/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## What does this PR do?
|
||||
- [ ] Summarize the changes made in a sentence or two
|
||||
- [ ] List the affected files or modules
|
||||
- [ ] Describe any notable features or improvements
|
||||
|
||||
## Description of Task to be completed
|
||||
- [ ] Provide a detailed description of the task or issue that this PR addresses
|
||||
|
||||
## How should this be manually tested?
|
||||
- [ ] Provide a step-by-step guide for how to test the changes
|
||||
- [ ] List any test data or prerequisites that are needed
|
||||
|
||||
## Relevant Issues
|
||||
- #<NUMBER>
|
||||
|
||||
## Background context
|
||||
- [ ] Add any relevant information that will help reviewers understand the context of this PR
|
||||
|
||||
## Screenshots (Optional)
|
||||
- [ ] Add screenshots of the changes made (if applicable)
|
||||
|
||||
## Dependencies
|
||||
- [ ] List any dependencies or external libraries that are required for the changes
|
3
vendor/yoeunes/toastr/.github/SECURITY.md
vendored
Normal file
3
vendor/yoeunes/toastr/.github/SECURITY.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Security Policy
|
||||
|
||||
If you discover any security related issues, please email younes.khoubza@gmail.com instead of using the issue tracker.
|
24
vendor/yoeunes/toastr/.github/workflows/issues.yml
vendored
Normal file
24
vendor/yoeunes/toastr/.github/workflows/issues.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
name: issues
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
help-wanted:
|
||||
if: github.event.label.name == 'help wanted'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Add comment
|
||||
uses: peter-evans/create-or-update-comment@v2
|
||||
with:
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
body: |
|
||||
Thank you for reporting this issue!
|
||||
|
||||
As yoeunes/toastr is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
|
||||
|
||||
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed.
|
||||
|
||||
Thank you!
|
28
vendor/yoeunes/toastr/.php-cs-fixer.dist.php
vendored
Normal file
28
vendor/yoeunes/toastr/.php-cs-fixer.dist.php
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
$header = <<<'EOF'
|
||||
This file is part of the yoeunes/toastr package.
|
||||
(c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
EOF;
|
||||
|
||||
$rules = array(
|
||||
'@Symfony' => true,
|
||||
'header_comment' => array('header' => $header),
|
||||
'array_syntax' => array('syntax' => 'long'),
|
||||
'visibility_required' => array('elements' => array('property', 'method')),
|
||||
);
|
||||
|
||||
$finder = new PhpCsFixer\Finder();
|
||||
$finder->in(__DIR__)->exclude(__DIR__.'/vendor');
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
|
||||
return $config->setFinder($finder)
|
||||
->setUsingCache(false)
|
||||
->setRiskyAllowed(true)
|
||||
->setRules($rules);
|
16
vendor/yoeunes/toastr/.phpstorm.meta.php
vendored
Normal file
16
vendor/yoeunes/toastr/.phpstorm.meta.php
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace PHPSTORM_META;
|
||||
|
||||
expectedArguments(\Yoeunes\Toastr\ToastrBuilder::showMethod(), 0, 'fadeIn', 'fadeOut', 'slideDown', 'show');
|
||||
expectedArguments(\Yoeunes\Toastr\ToastrBuilder::hideMethod(), 0, 'fadeIn', 'fadeOut', 'slideDown', 'show');
|
||||
expectedArguments(\Yoeunes\Toastr\ToastrBuilder::showEasing(), 0, 'swing', 'linear');
|
||||
expectedArguments(\Yoeunes\Toastr\ToastrBuilder::hideEasing(), 0, 'swing', 'linear');
|
||||
expectedArguments(\Yoeunes\Toastr\ToastrBuilder::positionClass(), 0, 'toast-top-right', 'toast-top-center', 'toast-bottom-center', 'toast-top-full-width', 'toast-bottom-full-width', 'toast-top-left', 'toast-bottom-right', 'toast-bottom-left');
|
||||
|
||||
$mapping = map([
|
||||
'toastr' => \Flasher\Toastr\Prime\ToastrFactory::class
|
||||
]);
|
||||
|
||||
override(\Flasher\Prime\FlasherInterface::create(), map($mapping));
|
||||
override(\Flasher\Prime\FlasherInterface::using(), map($mapping));
|
21
vendor/yoeunes/toastr/LICENSE
vendored
Normal file
21
vendor/yoeunes/toastr/LICENSE
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 yoeunes
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
178
vendor/yoeunes/toastr/README.md
vendored
Normal file
178
vendor/yoeunes/toastr/README.md
vendored
Normal file
@ -0,0 +1,178 @@
|
||||
<h1 align="center">Toastr.js notifications for Laravel</h1>
|
||||
|
||||
<p align="center">:eyes: This package helps you to add <a href="https://github.com/CodeSeven/toastr">toastr.js</a> notifications to your Laravel projects.</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://packagist.org/packages/yoeunes/toastr"><img src="https://poser.pugx.org/yoeunes/toastr/v/stable" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/yoeunes/toastr"><img src="https://poser.pugx.org/yoeunes/toastr/v/unstable" alt="Latest Unstable Version"></a>
|
||||
<a href="https://packagist.org/packages/yoeunes/toastr"><img src="https://poser.pugx.org/yoeunes/toastr/downloads" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/yoeunes/toastr"><img src="https://poser.pugx.org/yoeunes/toastr/license" alt="License"></a>
|
||||
</p>
|
||||
|
||||
<p align="center"><img width="300" alt="toastr" src="https://user-images.githubusercontent.com/10859693/39634578-1a9f121a-4fb3-11e8-8863-d64fad42901b.png"></p>
|
||||
|
||||
## Install
|
||||
|
||||
You can install the package using composer
|
||||
|
||||
```sh
|
||||
composer require yoeunes/toastr
|
||||
```
|
||||
|
||||
## Usage:
|
||||
|
||||
The usage of this package is very simple and straightforward. it only required one step to use it :
|
||||
|
||||
Use `toastr()` helper function inside your controller to set a toast notification for info, success, warning or error
|
||||
|
||||
```php
|
||||
// Display an error toast with no title
|
||||
toastr()->error('Oops! Something went wrong!');
|
||||
```
|
||||
|
||||
As an example:
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Post;
|
||||
use App\Http\Requests\PostRequest;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PostController extends Controller
|
||||
{
|
||||
public function store(PostRequest $request)
|
||||
{
|
||||
$post = Post::create($request->only(['title', 'body']));
|
||||
|
||||
if ($post instanceof Model) {
|
||||
toastr()->success('Data has been saved successfully!');
|
||||
|
||||
return redirect()->route('posts.index');
|
||||
}
|
||||
|
||||
toastr()->error('An error has occurred please try again later.');
|
||||
|
||||
return back();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Other Options
|
||||
|
||||
```php
|
||||
// Set a warning toast, with no title
|
||||
toastr()->warning('Are you sure you want to proceed ?');
|
||||
|
||||
// Set a success toast, with a title
|
||||
toastr()->success('Data has been saved successfully!', 'Congrats');
|
||||
|
||||
// Set an error toast, with a title
|
||||
toastr()->error('Oops! Something went wrong!', 'Oops!');
|
||||
|
||||
// Override global config options from 'config/toastr.php'
|
||||
toastr()->success('Data has been saved successfully!', 'Congrats', ['timeOut' => 5000]);
|
||||
```
|
||||
|
||||
### Other api methods:
|
||||
|
||||
You can also chain multiple messages together using method chaining
|
||||
|
||||
```php
|
||||
toastr()
|
||||
->info('Welcome back')
|
||||
->success('Data has been saved successfully!')
|
||||
->warning('Are you sure you want to proceed ?');
|
||||
```
|
||||
|
||||
You can use `toastr('')` instead of `toastr()->success()`
|
||||
|
||||
```php
|
||||
function toastr(string $message = null, string $type = 'success', string $title = '', array $options = []);
|
||||
```
|
||||
|
||||
So
|
||||
|
||||
* `toastr($message)` is equivalent to `toastr()->success($message)`
|
||||
* `toastr($message, 'info')` is equivalent to `toastr()->info($message)`
|
||||
* `toastr($message, 'warning')` is equivalent to `toastr()->warning($message)`
|
||||
* `toastr($message, 'error') ` is equivalent to `toastr()->error($message)`
|
||||
|
||||
### configuration:
|
||||
|
||||
As optional if you want to modify the default configuration, you can publish the configuration file:
|
||||
|
||||
```sh
|
||||
php artisan vendor:publish --provider="Yoeunes\Toastr\ToastrServiceProvider"
|
||||
```
|
||||
|
||||
```php
|
||||
// config/toastr.php
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Toastr options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you can specify the options that will be passed to the toastr.js
|
||||
| library. For a full list of options, visit the documentation.
|
||||
|
|
||||
*/
|
||||
|
||||
'options' => [
|
||||
'closeButton' => true,
|
||||
'closeClass' => 'toast-close-button',
|
||||
'closeDuration' => 300,
|
||||
'closeEasing' => 'swing',
|
||||
'closeHtml' => '<button><i class="icon-off"></i></button>',
|
||||
'closeMethod' => 'fadeOut',
|
||||
'closeOnHover' => true,
|
||||
'containerId' => 'toast-container',
|
||||
'debug' => false,
|
||||
'escapeHtml' => false,
|
||||
'extendedTimeOut' => 10000,
|
||||
'hideDuration' => 1000,
|
||||
'hideEasing' => 'linear',
|
||||
'hideMethod' => 'fadeOut',
|
||||
'iconClass' => 'toast-info',
|
||||
'iconClasses' => [
|
||||
'error' => 'toast-error',
|
||||
'info' => 'toast-info',
|
||||
'success' => 'toast-success',
|
||||
'warning' => 'toast-warning',
|
||||
],
|
||||
'messageClass' => 'toast-message',
|
||||
'newestOnTop' => false,
|
||||
'onHidden' => null,
|
||||
'onShown' => null,
|
||||
'positionClass' => 'toast-top-right',
|
||||
'preventDuplicates' => true,
|
||||
'progressBar' => true,
|
||||
'progressClass' => 'toast-progress',
|
||||
'rtl' => false,
|
||||
'showDuration' => 300,
|
||||
'showEasing' => 'swing',
|
||||
'showMethod' => 'fadeIn',
|
||||
'tapToDismiss' => true,
|
||||
'target' => 'body',
|
||||
'timeOut' => 5000,
|
||||
'titleClass' => 'toast-title',
|
||||
'toastClass' => 'toast',
|
||||
],
|
||||
];
|
||||
```
|
||||
For a list of available options, see [toastr.js' documentation](https://github.com/CodeSeven/toastr).
|
||||
|
||||
## Credits
|
||||
|
||||
- [Younes Khoubza](https://github.com/yoeunes)
|
||||
- [All Contributors](../../contributors)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
72
vendor/yoeunes/toastr/composer.json
vendored
Normal file
72
vendor/yoeunes/toastr/composer.json
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
{
|
||||
"name": "yoeunes/toastr",
|
||||
"description": "toastr.js flush notifications for Laravel",
|
||||
"license": "MIT",
|
||||
"type": "library",
|
||||
"keywords": [
|
||||
"toastr",
|
||||
"toastr js",
|
||||
"php-flasher",
|
||||
"flash-messages",
|
||||
"notification-system",
|
||||
"user-feedback",
|
||||
"sweetalert",
|
||||
"pnotify",
|
||||
"noty",
|
||||
"notyf",
|
||||
"desktop-notifications",
|
||||
"php",
|
||||
"laravel",
|
||||
"symfony",
|
||||
"javascript",
|
||||
"yoeunes",
|
||||
"framework-agnostic",
|
||||
"phpstorm-auto-complete",
|
||||
"custom-adapter",
|
||||
"user-experience",
|
||||
"rtl",
|
||||
"dark-mode"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Younes KHOUBZA",
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"homepage": "https://www.linkedin.com/in/younes-khoubza",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"homepage": "https://github.com/yoeunes/toastr",
|
||||
"support": {
|
||||
"email": "younes.khoubza@gmail.com",
|
||||
"issues": "https://github.com/yoeunes/toastr/issues",
|
||||
"source": "https://github.com/yoeunes/toastr",
|
||||
"docs": "https://github.com/yoeunes/toastr/README.md"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher-laravel": "^1.15.14"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Yoeunes\\Toastr\\": "src"
|
||||
},
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"aliases": {
|
||||
"Toastr": "Yoeunes\\Toastr\\Facades\\Toastr"
|
||||
},
|
||||
"providers": [
|
||||
"Yoeunes\\Toastr\\ToastrServiceProvider"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
27
vendor/yoeunes/toastr/config/toastr.php
vendored
Normal file
27
vendor/yoeunes/toastr/config/toastr.php
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
return array(
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Toastr options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you can specify the options that will be passed to the toastr.js
|
||||
| library. For a full list of options, visit the documentation.
|
||||
|
|
||||
| Example:
|
||||
| 'options' => [
|
||||
| 'closeButton' => true,
|
||||
| 'debug' => false,
|
||||
| 'newestOnTop' => false,
|
||||
| 'progressBar' => true,
|
||||
| ],
|
||||
*/
|
||||
|
||||
'options' => array(),
|
||||
);
|
30
vendor/yoeunes/toastr/src/Facades/Toastr.php
vendored
Normal file
30
vendor/yoeunes/toastr/src/Facades/Toastr.php
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Yoeunes\Toastr\Facades;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* @method static \Yoeunes\Toastr\Toastr error(string $message, string $title = '', array $options = [])
|
||||
* @method static \Yoeunes\Toastr\Toastr info(string $message, string $title = '', array $options = [])
|
||||
* @method static \Yoeunes\Toastr\Toastr success(string $message, string $title = '', array $options = [])
|
||||
* @method static \Yoeunes\Toastr\Toastr warning(string $message, string $title = '', array $options = [])
|
||||
* @method static \Yoeunes\Toastr\Toastr addNotification(string $type, string $message, string $title = '', array $options = [])
|
||||
*/
|
||||
class Toastr extends Facade
|
||||
{
|
||||
/**
|
||||
* Get the registered name of the component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'toastr';
|
||||
}
|
||||
}
|
1
vendor/yoeunes/toastr/src/Resources/assets/flasher-toastr.min.js
vendored
Normal file
1
vendor/yoeunes/toastr/src/Resources/assets/flasher-toastr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
vendor/yoeunes/toastr/src/Resources/assets/jquery.min.js
vendored
Normal file
2
vendor/yoeunes/toastr/src/Resources/assets/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
19
vendor/yoeunes/toastr/src/Resources/config.php
vendored
Normal file
19
vendor/yoeunes/toastr/src/Resources/config.php
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
return array(
|
||||
'scripts' => array(
|
||||
'cdn' => array(
|
||||
'https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js',
|
||||
'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.2.4/dist/flasher-toastr.min.js',
|
||||
),
|
||||
'local' => array(
|
||||
'/vendor/flasher/jquery.min.js',
|
||||
'/vendor/flasher/flasher-toastr.min.js',
|
||||
),
|
||||
),
|
||||
);
|
110
vendor/yoeunes/toastr/src/Toastr.php
vendored
Normal file
110
vendor/yoeunes/toastr/src/Toastr.php
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Yoeunes\Toastr;
|
||||
|
||||
class Toastr
|
||||
{
|
||||
const ERROR = 'error';
|
||||
const INFO = 'info';
|
||||
const SUCCESS = 'success';
|
||||
const WARNING = 'warning';
|
||||
|
||||
/**
|
||||
* @var ToastrFactory
|
||||
*/
|
||||
private $toastrFactory;
|
||||
|
||||
/**
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
private $options;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $options
|
||||
*/
|
||||
public function __construct(ToastrFactory $toastrFactory, array $options = array())
|
||||
{
|
||||
$this->toastrFactory = $toastrFactory;
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut for adding an error notification.
|
||||
*
|
||||
* @param string $message The notification's message
|
||||
* @param string $title The notification's title
|
||||
* @param array<string, mixed> $options The notification's options
|
||||
*
|
||||
* @return Toastr
|
||||
*/
|
||||
public function error($message, $title = '', array $options = array())
|
||||
{
|
||||
return $this->addNotification(self::ERROR, $message, $title, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut for adding an info notification.
|
||||
*
|
||||
* @param string $message The notification's message
|
||||
* @param string $title The notification's title
|
||||
* @param array<string, mixed> $options The notification's options
|
||||
*
|
||||
* @return Toastr
|
||||
*/
|
||||
public function info($message, $title = '', array $options = array())
|
||||
{
|
||||
return $this->addNotification(self::INFO, $message, $title, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut for adding a success notification.
|
||||
*
|
||||
* @param string $message The notification's message
|
||||
* @param string $title The notification's title
|
||||
* @param array<string, mixed> $options The notification's options
|
||||
*
|
||||
* @return Toastr
|
||||
*/
|
||||
public function success($message, $title = '', array $options = array())
|
||||
{
|
||||
return $this->addNotification(self::SUCCESS, $message, $title, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut for adding a warning notification.
|
||||
*
|
||||
* @param string $message The notification's message
|
||||
* @param string $title The notification's title
|
||||
* @param array<string, mixed> $options The notification's options
|
||||
*
|
||||
* @return Toastr
|
||||
*/
|
||||
public function warning($message, $title = '', array $options = array())
|
||||
{
|
||||
return $this->addNotification(self::WARNING, $message, $title, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a notification.
|
||||
*
|
||||
* @param string $type could be error, info, success, or warning
|
||||
* @param string $message The notification's message
|
||||
* @param string $title The notification's title
|
||||
* @param array<string, mixed> $options The notification's options
|
||||
*
|
||||
* @return Toastr
|
||||
*/
|
||||
public function addNotification($type, $message, $title = '', array $options = array())
|
||||
{
|
||||
$options = array_merge($this->options, $options);
|
||||
|
||||
$this->toastrFactory->addFlash($type, $message, $title, $options);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
454
vendor/yoeunes/toastr/src/ToastrBuilder.php
vendored
Normal file
454
vendor/yoeunes/toastr/src/ToastrBuilder.php
vendored
Normal file
@ -0,0 +1,454 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Yoeunes\Toastr;
|
||||
|
||||
use Flasher\Prime\Notification\NotificationBuilder;
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.TooManyMethods)
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
*/
|
||||
final class ToastrBuilder extends NotificationBuilder
|
||||
{
|
||||
/**
|
||||
* Enable a close button.
|
||||
*
|
||||
* @param bool $closeButton
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function closeButton($closeButton = true)
|
||||
{
|
||||
$this->option('closeButton', $closeButton);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $closeClass
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function closeClass($closeClass)
|
||||
{
|
||||
$this->closeButton();
|
||||
|
||||
$this->option('closeClass', $closeClass);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $closeDuration
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function closeDuration($closeDuration)
|
||||
{
|
||||
$this->option('closeDuration', $closeDuration);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $closeEasing
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function closeEasing($closeEasing)
|
||||
{
|
||||
$this->option('closeEasing', $closeEasing);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the close button's HTML.
|
||||
*
|
||||
* @param string $closeHtml
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function closeHtml($closeHtml)
|
||||
{
|
||||
$this->option('closeHtml', $closeHtml);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $closeMethod
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function closeMethod($closeMethod)
|
||||
{
|
||||
$this->option('closeMethod', $closeMethod);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $closeOnHover
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function closeOnHover($closeOnHover = true)
|
||||
{
|
||||
$this->option('closeOnHover', $closeOnHover);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $containerId
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function containerId($containerId)
|
||||
{
|
||||
$this->option('containerId', $containerId);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $debug
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function debug($debug = true)
|
||||
{
|
||||
$this->option('debug', $debug);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* In case you want to escape HTML characters in title and message.
|
||||
*
|
||||
* @param bool $escapeHtml
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function escapeHtml($escapeHtml = true)
|
||||
{
|
||||
$this->option('escapeHtml', $escapeHtml);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* How long the toast will display after a user hovers over it.
|
||||
*
|
||||
* @param int $extendedTimeOut
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function extendedTimeOut($extendedTimeOut)
|
||||
{
|
||||
$this->option('extendedTimeOut', $extendedTimeOut);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the time during which the pop-up closes in ms.
|
||||
*
|
||||
* @param int $hideDuration
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function hideDuration($hideDuration)
|
||||
{
|
||||
$this->option('hideDuration', $hideDuration);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates the entry transition of the pop-up.
|
||||
*
|
||||
* @param string $hideEasing
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function hideEasing($hideEasing)
|
||||
{
|
||||
$this->option('hideEasing', $hideEasing);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates the opening animation of the pop-up.
|
||||
*
|
||||
* @param string $hideMethod
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function hideMethod($hideMethod)
|
||||
{
|
||||
$this->option('hideMethod', $hideMethod);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $iconClass
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function iconClass($iconClass)
|
||||
{
|
||||
$this->option('iconClass', $iconClass);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $messageClass
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function messageClass($messageClass)
|
||||
{
|
||||
$this->option('messageClass', $messageClass);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show newest toast at bottom (top is default).
|
||||
*
|
||||
* @param bool $newestOnTop
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function newestOnTop($newestOnTop = true)
|
||||
{
|
||||
$this->option('newestOnTop', $newestOnTop);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $onHidden
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function onHidden($onHidden)
|
||||
{
|
||||
$this->option('onHidden', $onHidden);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $onShown
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function onShown($onShown)
|
||||
{
|
||||
$this->option('onShown', $onShown);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $positionClass
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function positionClass($positionClass)
|
||||
{
|
||||
$this->option('positionClass', $positionClass);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to
|
||||
* the previous toast based on their message content.
|
||||
*
|
||||
* @param bool $preventDuplicates
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function preventDuplicates($preventDuplicates = true)
|
||||
{
|
||||
$this->option('preventDuplicates', $preventDuplicates);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Visually indicate how long before a toast expires.
|
||||
*
|
||||
* @param bool $progressBar
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function progressBar($progressBar = true)
|
||||
{
|
||||
$this->option('progressBar', $progressBar);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $progressClass
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function progressClass($progressClass)
|
||||
{
|
||||
$this->option('progressClass', $progressClass);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip the toastr to be displayed properly for right-to-left languages.
|
||||
*
|
||||
* @param bool $rtl
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function rtl($rtl = true)
|
||||
{
|
||||
$this->option('rtl', $rtl);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the time during which the pop-up opens in ms.
|
||||
*
|
||||
* @param int $showDuration
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function showDuration($showDuration)
|
||||
{
|
||||
$this->option('showDuration', $showDuration);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates the entry transition of the pop-up.
|
||||
*
|
||||
* @param string $showEasing
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function showEasing($showEasing)
|
||||
{
|
||||
$this->option('showEasing', $showEasing);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates the opening animation of the pop-up.
|
||||
*
|
||||
* @param string $showMethod
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function showMethod($showMethod)
|
||||
{
|
||||
$this->option('showMethod', $showMethod);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Forces the user to validate the pop-up before closing.
|
||||
*
|
||||
* @param bool $tapToDismiss
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function tapToDismiss($tapToDismiss = true)
|
||||
{
|
||||
$this->option('tapToDismiss', $tapToDismiss);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $target
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function target($target)
|
||||
{
|
||||
$this->option('target', $target);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* How long the toast will display without user interaction.
|
||||
*
|
||||
* @param int $timeOut
|
||||
* @param int $extendedTimeOut
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function timeOut($timeOut, $extendedTimeOut = null)
|
||||
{
|
||||
$this->option('timeOut', $timeOut);
|
||||
|
||||
if (null !== $extendedTimeOut) {
|
||||
$this->extendedTimeOut($extendedTimeOut);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $titleClass
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function titleClass($titleClass)
|
||||
{
|
||||
$this->option('titleClass', $titleClass);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $toastClass
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function toastClass($toastClass)
|
||||
{
|
||||
$this->option('toastClass', $toastClass);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent from Auto Hiding.
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function persistent()
|
||||
{
|
||||
$this->timeOut(0);
|
||||
$this->extendedTimeOut(0);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
25
vendor/yoeunes/toastr/src/ToastrFactory.php
vendored
Normal file
25
vendor/yoeunes/toastr/src/ToastrFactory.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Yoeunes\Toastr;
|
||||
|
||||
use Flasher\Prime\Factory\NotificationFactory;
|
||||
use Flasher\Prime\Notification\Notification;
|
||||
|
||||
/**
|
||||
* @mixin ToastrBuilder
|
||||
*/
|
||||
final class ToastrFactory extends NotificationFactory
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createNotificationBuilder()
|
||||
{
|
||||
return new ToastrBuilder($this->getStorageManager(), new Notification(), 'toastr');
|
||||
}
|
||||
}
|
30
vendor/yoeunes/toastr/src/ToastrPlugin.php
vendored
Normal file
30
vendor/yoeunes/toastr/src/ToastrPlugin.php
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Yoeunes\Toastr;
|
||||
|
||||
use Flasher\Prime\Plugin\Plugin;
|
||||
|
||||
class ToastrPlugin extends Plugin
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getScripts()
|
||||
{
|
||||
return array(
|
||||
'cdn' => array(
|
||||
'https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js',
|
||||
'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.2.4/dist/flasher-toastr.min.js',
|
||||
),
|
||||
'local' => array(
|
||||
'/vendor/flasher/jquery.min.js',
|
||||
'/vendor/flasher/flasher-toastr.min.js',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
74
vendor/yoeunes/toastr/src/ToastrServiceProvider.php
vendored
Normal file
74
vendor/yoeunes/toastr/src/ToastrServiceProvider.php
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
namespace Yoeunes\Toastr;
|
||||
|
||||
use Flasher\Laravel\Support\ServiceProvider;
|
||||
|
||||
class ToastrServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function afterBoot()
|
||||
{
|
||||
$this->publishes(array(
|
||||
__DIR__.'/../config/toastr.php' => config_path('toastr.php'),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function afterRegister()
|
||||
{
|
||||
$this->mergeConfigFrom(
|
||||
__DIR__.'/../config/toastr.php',
|
||||
'toastr'
|
||||
);
|
||||
|
||||
$this->registerToastr();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return array(
|
||||
'toastr',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ToastrPlugin
|
||||
*/
|
||||
public function createPlugin()
|
||||
{
|
||||
return new ToastrPlugin();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function registerToastr()
|
||||
{
|
||||
$this->app->singleton('toastr', function ($app) {
|
||||
$options = $app['config']->get('toastr.options', array());
|
||||
|
||||
return new Toastr($app['flasher.toastr'], $options);
|
||||
});
|
||||
|
||||
$this->app->alias('toastr', 'Yoeunes\Toastr\Toastr');
|
||||
}
|
||||
}
|
29
vendor/yoeunes/toastr/src/helpers.php
vendored
Normal file
29
vendor/yoeunes/toastr/src/helpers.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the yoeunes/toastr package.
|
||||
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
|
||||
*/
|
||||
|
||||
use Yoeunes\Toastr\Toastr;
|
||||
|
||||
if (!function_exists('toastr')) {
|
||||
/**
|
||||
* @see https://php-flasher.io/
|
||||
*
|
||||
* @param string $message The notification's message
|
||||
* @param string $type could be error, info, success, or warning
|
||||
* @param string $title The notification's title
|
||||
* @param array<string, mixed> $options The notification's options
|
||||
*
|
||||
* @return Toastr
|
||||
*/
|
||||
function toastr($message = null, $type = 'success', $title = '', array $options = array())
|
||||
{
|
||||
if (null === $message) {
|
||||
return app('toastr');
|
||||
}
|
||||
|
||||
return app('toastr')->addNotification($type, $message, $title, $options);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user