From e9d233a702dadd1124cb7da5ac3258c58695f135 Mon Sep 17 00:00:00 2001 From: KHOUBZA Younes Date: Tue, 5 Oct 2021 01:25:00 +0100 Subject: [PATCH] Wip --- .editorconfig | 10 ++++++++++ docs/index.md | 28 +++++++++++++++------------- docs/installation.md | 38 +++++++++++++++++++------------------- docs/usage.md | 15 +++++++-------- 4 files changed, 51 insertions(+), 40 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b175ed5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +max_line_length = 120 +tab_width = 4 diff --git a/docs/index.md b/docs/index.md index db035c4..f831dc8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,7 +3,7 @@ permalink: /docs/ title: A powerful and flexible flash notifications' system for PHP hide_title: true published_at: 2020-11-28 -updated_at: 2020-11-28 +updated_at: 2021-10-05 ---
@@ -19,32 +19,33 @@ updated_at: 2020-11-28 Software License Total Downloads php >=5.3 - Sponsors - Backers

+> If you like **PHPFlasher** please consider giving it a star on github. + # What is PHP Flasher ? Flash messages are a great way to add some simple notifications to users of your website or application about important events that may have happened. -**Flasher** gives a straightforward way to give feedback messages in the current or next page to users with the flashing system. +**PHPFlasher** gives a straightforward way to give feedback messages in the current or next page to users with the flashing system. The flashing system basically makes it possible to record a message and store it within the session so that it can be retrieved when needed. # Why use PHP Flasher ? -Flasher supports many notification libraries : __tailwindcss__, __bootstrap__, __toastr.js__, __sweet alert 2__, __pnotify__, __noty__ and __notyf__ -and its highly extendable, so you can add custom adapters. +**PHPFlasher** supports many notification libraries : __tailwindcss__, __bootstrap__, __toastr.js__, __sweet alert 2__, __pnotify__, __noty__, __notyf__ and even show __desktop__ notifications. This library is designed, so you can take full control when creating you notifications : -> * Show various notifications simultaneously -> * Sort and filter notifications like a database -> * Render notification from JSON response -> * Limit the amount displayed notifications -> * Show notifications from various adapters simultaneously -> * Framework agnostic with implementations for: Laravel and Symfony -> * ...and more +* Show various notifications simultaneously +* Sort and filter notifications +* Render notifications from JSON response (ajax) +* Limit the amount of displayed notifications +* Show Desktop notifications for : Linux, MacOS and Windows +* Framework-agnostic with implementations for: Laravel and Symfony +* Autocomplete for PHPSTORM +* You can always create an adapter yourself +* ...and more # Getting Started @@ -56,3 +57,4 @@ This library is designed, so you can take full control when creating you notific * **[Noty](/docs/adapter/noty/)** * **[Tailwind CSS](/docs/adapter/template/tailwindcss/)** * **[Bootstrap](/docs/adapter/template/bootstrap/)** +* **[Desktop](/docs/adapter/template/desktop/)** diff --git a/docs/installation.md b/docs/installation.md index c0cc2c1..a372f5f 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -2,20 +2,22 @@ permalink: /docs/installation/ title: Installation published_at: 2020-11-28 -updated_at: 2020-11-28 +updated_at: 2021-10-05 --- -PHP flasher consists of multiple parts and came with a default __template__ driver which include __tailwindcss__ and __bootstrap__ notifications. +**PHPFlasher** consists of multiple parts and +came with a default __template__ driver which include __tailwindcss__ and __bootstrap__ notifications. ## Installation -PHP Flasher can be installed using composer. +**PHPFlasher** can be installed using +composer.
composer require php-flasher/flasher
-Additionally, you may want to install an extra adapter (library) to show a specific types of toast notifications, you can find the adapters in the menu. +Additionally, you may want to install an extra adapter (library) to display a specific type of notifications, you can +find the adapters in the menu. -* **[Installation](/docs/installation/)** * **[Toastr](/docs/adapter/toastr/)** * **[Sweet Alert](/docs/adapter/sweet-alert/)** * **[Pnotify](/docs/adapter/pnotify/)** @@ -23,8 +25,10 @@ Additionally, you may want to install an extra adapter (library) to show a speci * **[Noty](/docs/adapter/noty/)** * **[Tailwind CSS](/docs/adapter/template/tailwindcss/)** * **[Bootstrap](/docs/adapter/template/bootstrap/)** +* **[Desktop](/docs/adapter/template/desktop/)** -PHP Flasher also offers a solid integration with Laravel and Symfony : +**PHPFlasher** also offers a solid integration +with Laravel and Symfony : **For Laravel**:
composer require php-flasher/flasher-laravel
@@ -32,15 +36,10 @@ PHP Flasher also offers a solid integration with Laravel and Symfony : **For Symfony**:
composer require php-flasher/flasher-symfony
-## Simple Usage +## General Usage -The Flasher API is the most important interface Flasher describes when you want to use Flasher in your application. - -> If you're using a framework like __Laravel__ or __Symfony__, just grab an instance of __FlasherInterface__. - -```php -$flasher->addSuccess('Data has been saved successfully!'); -``` +If you're using a framework like __Laravel__ or __Symfony__, just grab an instance of __FlasherInterface__ from the +container ```php addSuccess('Data has been saved successfully!'); - + + flasher('Data has been saved successfully!') // only for the Laravel framework // ... redirect or render a view here } -} -``` \ No newline at end of file +} +``` diff --git a/docs/usage.md b/docs/usage.md index 4a94b93..fcc1bfc 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -2,16 +2,15 @@ permalink: /docs/usage/ title: Flasher Usage published_at: 2020-11-28 -updated_at: 2020-11-28 +updated_at: 2021-10-05 --- -The Flasher API is the most important interface Flasher describes when you want to use Flasher in your application. +> If you like PHPFlasher please consider giving it a star on github. -> If you're using a framework like __Laravel__ or __Symfony__, just grabe an instance of __FlasherInterface__. +If you're using a framework like __Laravel__ or __Symfony__, just grab an instance of __FlasherInterface__ from the +container, and you're ready to go -
- -## Simple Usage +## General Usage ```php $flasher->addFlash('success', 'Data has been saved successfully!'); @@ -25,7 +24,7 @@ param | description ----------------|------------------------------------------------- `$type` | Notification type : success, error, warning, info ....etc `$message` | The message to be displayed -`$options` | Additional options to be available in javascript +`$options` | Options for the javascript libraries `$notification` | The notification already stored in the session and ready to be rendered There are also 4 shortcuts for the `addFlash()` method : @@ -227,4 +226,4 @@ param | description `$stamps` | Attach multiple stamps at the same time to the current notification `$envelope` | get the current notification with all stamps and options attached to it, in a single object instance of the Envelope class ---- \ No newline at end of file +---