minhajul / notify
Flash Notification
1.0.2
2020-12-02 06:49 UTC
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2025-04-29 01:01:35 UTC
README
Using Composer
composer require minhajul/notify
Add the service provider to config/app.php
Minhajul\Notify\NotifyServiceProvider::class,
Optionally include the Facade in config/app.php
if you'd like.
'Notify' => Minhajul\Notify\Facades\Notify::class,
Usage
Basic
From your application, call the flash
method with a message and type.
notify()->flash('Welcome back!', 'success');
Within a view, you can now check if a flash message exists and output it.
@if (notify()->ready()) <div class="alert-box {{ notify()->type() }}"> {{ notify()->message() }} </div> @endif
Then, in your view.
@if (notify()->ready()) <script> swal({ title: "{!! notify()->message() !!}", text: "{!! notify()->option('text') !!}", type: "{{ notify()->type() }}" }); </script> @endif