Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function rules() |
||
26 | { |
||
27 | return [ |
||
28 | 'name' => 'required|string|min:3', |
||
29 | 'email' => 'required|email', |
||
30 | 'phone' => 'required', //todo write a regex to serve, |
||
31 | 'links' => 'array', |
||
32 | 'color' => 'required|'.Helper::$hexColorRegex, |
||
33 | 'location' => 'array', |
||
34 | 'links.*' => 'url', |
||
35 | 'statement' => 'array', |
||
36 | 'statement.*' => 'string', |
||
37 | 'emails' => 'array', |
||
38 | 'phones' => 'array', |
||
39 | 'emails.*' => 'email', |
||
40 | 'services' => 'array', |
||
41 | 'services.*.day' => 'required|in:'.implode(',', Helper::$weekDays), |
||
42 | 'services.*.start' => ['required', 'date_format:H:i', 'regex:/^((([01]?[0-9]|2[0-3]):[0-5][0-9])?)$/'], |
||
43 | 'services.*.finish' => ['required', 'date_format:H:i', 'regex:/^((([01]?[0-9]|2[0-3]):[0-5][0-9])?)$/'], |
||
44 | 'services.*.alias' => 'nullable', |
||
45 | ]; |
||
48 |