mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
add cliFlasher laravel helper method
This commit is contained in:
@@ -42,6 +42,9 @@
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
],
|
||||
"files": [
|
||||
"helpers.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
if (!function_exists('cliFlasher')) {
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string $type
|
||||
*
|
||||
* @return Flasher\Cli\Prime\CliFlasherInterface
|
||||
*/
|
||||
function cliFlasher($message = null, $renderImmediately = true, $type = 'success', array $options = array(), array $stamps = array())
|
||||
{
|
||||
/** @var Flasher\Cli\Prime\CliFlasherInterface $flasher */
|
||||
$flasher = app('flasher.cli');
|
||||
|
||||
if (null === $message && 0 === func_num_args()) {
|
||||
return $flasher;
|
||||
}
|
||||
|
||||
return $flasher->with($stamps)->desktop($renderImmediately)->addFlash($type, $message, $options);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user