dev-master
9999999-devChearaan Tool
MIT
The Requires
by S Chandrasegarran
Wallogit.com
2017 © Pedro Peláez
Chearaan Tool
Chearaan Tools, (*1)
Using Composer composer require chearaan/advice, (*2)
Add the service provider to config/app.php, (*3)
Chearaan\Advice\AdviceServiceProvider::class, Optionally include the Facade in config/app.php if you'd like., (*4)
Advice => Chearaan\Advice\Facades\Advice::class, Note, there is a advice() function available, so unless you really want to use the Facade, there's no need to include it., (*5)
Usage, (*6)
Basic, (*7)
From your application, call the flash method with a message and type. advice()->flash('Welcome back!', 'success');, (*8)
Within a view, you can now check if a flash message exists and output it., (*9)
@if (advice()->ready()), (*10)
@endif, (*11)
Notify is front-end framework agnostic, so you're free to easily implement the output however you choose. Options You can pass additional options to the flash method, which are then easily accessible within your view. advice()->flash('Welcome back!', 'success', [ 'timer' => 3000, 'text' => 'It\'s really great to see you again', ]); Then, in your view. @if (advice()->ready()), (*12)
@endif, (*13)
The above example uses SweetAlert, but the flexibily of Advice means you can easily use it with any JavaScript alert solution. Issues and contribution Just submit an issue or pull request through GitHub. Thanks!, (*14)
Chearaan Tool
MIT