| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function hasErrorAndShow(string $name, string $bag = 'default'): bool |
||
| 12 | { |
||
| 13 | if (!$this->showErrors) { |
||
| 14 | return false; |
||
| 15 | } |
||
| 16 | |||
| 17 | $errors = request()->session()->get('errors') ?: new ViewErrorBag; |
||
| 18 | |||
| 19 | $name = str_replace(['[', ']'], ['.', ''], $name); |
||
| 20 | |||
| 21 | return $errors->getBag($bag)->has($name); |
||
| 22 | } |
||
| 23 | } |
||
| 24 |