add cliFlasher laravel helper method

This commit is contained in:
Khoubza Younes
2021-10-02 01:08:08 +01:00
parent 742e457800
commit 4ab09ede26
2 changed files with 24 additions and 0 deletions
+3
View File
@@ -42,6 +42,9 @@
},
"exclude-from-classmap": [
"/Tests/"
],
"files": [
"helpers.php"
]
},
"autoload-dev": {
+21
View File
@@ -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);
}
}