If you find PHPFlasher useful, we would greatly appreciate your support in the form of a star rating ⭐ on GitHub or by sharing the project on Twitter click here. Your feedback helps us keep the package up-to-date and well-maintained. Thank you


Installation

Laravel:

composer require php-flasher/flasher-notyf-laravel


Symfony:

composer require php-flasher/flasher-notyf-symfony

Usage

#/ notyf

namespace App\Controller;

class AppController
{
    public function save()
    {        
        notyf()->addError('There was an issue uploading your file.');
    }
} 

Modifiers

For more information on Notyf options and usage, please refer to the original documentation at https://github.com/caroso1222/notyf


The methods described in the Usage section can also be used with the notyf adapter.


position

Viewport location where notifications are rendered

position x ⇒ left, center, right
position y ⇒ top, center, bottom

Default ⇒ x: right, y: bottom

notyf()->position(string $position, string $value);
#/ notyf position

notyf()
    ->position('x', 'center')
    ->position('y', 'top')
    ->addSuccess('Your feedback has been received.');

duration

Number of milliseconds before hiding the notification. Use 0 for infinite duration.

notyf()->duration(int $duration);
#/ notyf duration

notyf()
    ->duration(2000) // 2 seconds
    ->addSuccess('Your account has been verified.');

ripple

Whether to show the notification with a ripple effect

Default ⇒ true

notyf()->ripple(bool $ripple);
#/ notyf ripple true

notyf()
    ->ripple(true)
    ->addInfo('Your feedback has been submitted and is being reviewed.');
#/ notyf ripple false

notyf()
    ->ripple(false)
    ->addInfo('Your feedback has been submitted and is being reviewed.');

dismissible

Whether to allow users to dismiss the notification with a button

Default ⇒ false

notyf()->dismissible(bool $dismissible);
#/ notyf dismissible

notyf()
    ->dismissible(true)
    ->addInfo('Your order has been placed and is being processed.');
Younes

PHPFlasher is a project by Younes KHOUBZA.