Tool to use with Laravel Framework to facilitate sending messages from controllers to the views., (*1)
We use the Session component from Laravel to store messages, so works with redirects too., (*2)
Multiple messages from the same type are grouped into one message, separated by <br />
., (*3)
We have 4 type of messages:, (*4)
You specify the type of the message to send by calling a static method named with the type name., (*5)
use Beeblebrox3\Sysfeedback; Sysfeedback::success('this is a success message!'); sysfeedback::info('this is a information message'); Sysfeedback::error('this is a error message!'); Sysfeedback::warning('this is a warning message!');
To display the messages, use the render
method:, (*6)
use Beeblebrox3\Sysfeedback; Sysfeedback::success('this is a success message!'); Sysfeedback::render(); /* This method will print something like this:this is a success message!*/
You can customize the format of the output passing the new format to the render method., (*7)
use Beeblebrox3\Sysfeedback; Sysfeedback::success('this is a success message!'); Sysfeedback::render(':message'); /* This method will print something like this:this is a success message!*/
:message indicates where put the message text., (*8)
:type indicates where put the type of the message, usually to use as a class name to apply stylesheet., (*9)
:type
placeholder to put the type of the message instead of :class
;