Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | function flash(string $text = null, $class = null): Flash |
||
11 | { |
||
12 | /** @var \Spatie\Flash\Flash $flash */ |
||
13 | $flash = app(Flash::class); |
||
|
|||
14 | |||
15 | if (is_null($text)) { |
||
16 | return $flash; |
||
17 | } |
||
18 | |||
19 | $message = new Message($text, $class); |
||
20 | |||
21 | $flash->flash($message); |
||
22 | |||
23 | return $flash; |
||
24 | } |
||
25 |