Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
KHOUBZA Younes committed Oct 5, 2021
1 parent ae749b7 commit e9d233a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 40 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
28 changes: 15 additions & 13 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

<div class="text-center mb-8">
Expand All @@ -19,32 +19,33 @@ updated_at: 2020-11-28
<a href="https://github.com/php-flasher/flasher/blob/master/LICENSE"><img src="https:////img.shields.io/badge/license-MIT-brightgreen.svg" alt="Software License"></a>
<a href="https://packagist.org/packages/php-flasher/flasher"><img src="https://img.shields.io/packagist/dt/php-flasher/flasher.svg" alt="Total Downloads"></a>
<img src="https://img.shields.io/packagist/php-v/php-flasher/flasher.svg?style=flat-square" alt="php >=5.3">
<a href="https://opencollective.com/php-flasher"><img src="https://opencollective.com/php-flasher/tiers/sponsor/badge.svg?label=sponsor&amp;color=brightgreen" alt="Sponsors"></a>
<a href="https://opencollective.com/php-flasher"><img src="https://opencollective.com/php-flasher/tiers/backer/badge.svg?label=backer&amp;color=brightgreen" alt="Backers"></a>
</p>
</div>

> If you like **<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** please consider giving it a star on <a href="https://github.com/php-flasher/php-flasher">github</a>.
# 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.
**<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** 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.
**<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** 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

Expand All @@ -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/)**
38 changes: 19 additions & 19 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,44 @@
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.
**<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** 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.
**<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** can be installed using
composer.

<pre class="snippet"><code>composer require php-flasher/flasher</code></pre>

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/)**
* **[Notyf](/docs/adapter/notyf/)**
* **[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 :
**<span class="text-indigo-900">PHP<span class="text-indigo-500">Flasher</span></span>** also offers a solid integration
with Laravel and Symfony :

**For Laravel**:
<pre class="snippet"><code>composer require php-flasher/flasher-laravel</code></pre>

**For Symfony**:
<pre class="snippet"><code>composer require php-flasher/flasher-symfony</code></pre>

## 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
<?php
Expand All @@ -53,11 +52,12 @@ class NotifyController
{
public function flasher(FlasherInterface $flasher)
{
// ...
// ...

$flasher->addSuccess('Data has been saved successfully!');


flasher('Data has been saved successfully!') // only for the Laravel framework
// ... redirect or render a view here
}
}
```
}
```
15 changes: 7 additions & 8 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<br />

## Simple Usage
## General Usage

```php
$flasher->addFlash('success', 'Data has been saved successfully!');
Expand All @@ -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 :
Expand Down Expand Up @@ -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

---
---

0 comments on commit e9d233a

Please sign in to comment.