falgunphp / notification
v0.0.3
2021-06-24 18:03 UTC
Requires
- php: ^7.4|^8.0
- falgunphp/http: ^0.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- sempro/phpunit-pretty-print: ^1.4
- vimeo/psalm: ^3.18
This package is auto-updated.
Last update: 2025-05-25 03:00:12 UTC
README
Simple Notification Manager Library.
Install
Please note that PHP 7.4 or higher is required.
Via Composer
$ composer require falgunphp/notification
Usage
<?php use Falgun\Http\Session; use Falgun\Notification\Notification; $notification = new Notification(new Session()); $notification->successNote('Oh Yeah'); $notification->warningNote('Oh ho'); $notification->errorNote('hold up'); // all 3 notification has been saved to $_SESSION $notes = $notification->flashNotifications(); // to get notifications and remove them from session // or $notes = $notification->getNotifications(); // only get notifications and don't remove them foreach($notes as $note){ echo $note->getMessage(); // this is the message of the note echo $note->getType(); // success or warning or error }
License
The MIT License (MIT). Please see License File for more information.