1 | <?php |
||
7 | trait HandlesValidationErrors |
||
8 | { |
||
9 | public $showErrors = true; |
||
10 | |||
11 | /** |
||
12 | * Returns a boolean wether the given attribute has an error |
||
13 | * and the should be shown. |
||
14 | * |
||
15 | * @param string $name |
||
16 | * @param string $bag |
||
17 | * @return boolean |
||
18 | */ |
||
19 | public function hasErrorAndShow(string $name, string $bag = 'default'): bool |
||
25 | |||
26 | /** |
||
27 | * Returns a boolean wether the given attribute has an error. |
||
28 | * |
||
29 | * @param string $name |
||
30 | * @param string $bag |
||
31 | * @return boolean |
||
32 | */ |
||
33 | public function hasError(string $name, string $bag = 'default'): bool |
||
41 | } |
||
42 |