This package wraps laracasts/flash
in order to help escape HTML special characters with almost the same API.
Facade usage is not implemented since I only use the flash
helper!
I got tired of this
$username = e(auth()->user()->username);
flash()->success("Welcome, $username!");
And wanted this
eflash()->success('Welcome, %s!', auth()->user()->username);
You can install the package via composer:
composer require hugojf/eflash
Usage should be similar to laracasts/flash
and sprintf
function.
The first parameter (the template) is NOT escaped in order to allow some HTML in the message.
eflash()->success($format, ...$args);
eflash()->error($format, ...$args);
eflash()->info($format, ...$args);
eflash()->message($format, $level, ...$args);
eflash()->warning($format, ...$args);
eflash()->success('Welcome %s!', $username);
eflash()->error('Input <strong>%s</strong> is not valid!', $input);
eflash()->info('Server %s was turned off!', $serverName)->important();
eflash()->message('A boring %s', $message)->overlay();
eflash()->warning('Joined team <i>%s</i>!', $teamName)->overlay();
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The GNU GPLv3. Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.