| Total Complexity | 6 |
| Total Lines | 71 |
| Duplicated Lines | 0 % |
| Coverage | 50% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | abstract class FormRequest extends BaseFormRequest |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Determine if the user is authorized to make this request. |
||
| 14 | * |
||
| 15 | * @return bool |
||
| 16 | */ |
||
| 17 | 5 | public function authorize() |
|
| 18 | { |
||
| 19 | 5 | return true; |
|
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Get the validation rules that apply to the request. |
||
| 24 | * |
||
| 25 | * @return array |
||
| 26 | */ |
||
| 27 | 1 | public function rules() |
|
| 28 | { |
||
| 29 | 1 | return static::getRules(); |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Get the validation rules that apply to the request in static way. |
||
| 34 | * |
||
| 35 | * @return array |
||
| 36 | */ |
||
| 37 | public static function getRules() |
||
| 38 | { |
||
| 39 | return [ |
||
| 40 | // |
||
| 41 | ]; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * {@inheritDoc} |
||
| 46 | */ |
||
| 47 | 2 | public function attributes() |
|
| 48 | { |
||
| 49 | 2 | return static::getAttributes(); |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get custom attributes for validator errors in static way. |
||
| 54 | * |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | 1 | public static function getAttributes() |
|
| 58 | { |
||
| 59 | return [ |
||
| 60 | // |
||
| 61 | 1 | ]; |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Create the validator instance based on the given field name. |
||
| 66 | * |
||
| 67 | * @param mixed $data |
||
| 68 | * @param string $field |
||
| 69 | * @param array $messages |
||
| 70 | * @param bool $stopOnFirstFailure |
||
| 71 | * @return \Illuminate\Contracts\Validation\Validator |
||
| 72 | */ |
||
| 73 | public static function createValidator($data, string $field, array $messages = [], bool $stopOnFirstFailure = false): ValidationFactory |
||
| 81 | } |
||
| 82 | } |
||
| 83 |