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()->addSuccess('Your application has been received.');
    }
} 

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')
    ->addError('There was a problem re-activating your account.');

duration

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

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

notyf()
    ->duration(2000) // 2 seconds
    ->addError('There was a problem resetting your password.');

ripple

Whether to show the notification with a ripple effect

Default ⇒ true

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

notyf()
    ->ripple(true)
    ->addSuccess('Your account has been restored.');
#/ notyf ripple false

notyf()
    ->ripple(false)
    ->addSuccess('Your account has been restored.');

dismissible

Whether to allow users to dismiss the notification with a button

Default ⇒ false

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

notyf()
    ->dismissible(true)
    ->addError('There was a problem re-activating your account.');
Younes

PHPFlasher is a project by Younes KHOUBZA.