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,
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