1 | <?php namespace Arcanedev\Support\Bases; |
||
15 | abstract class FormRequest extends BaseFormRequest |
||
16 | { |
||
17 | /* ------------------------------------------------------------------------------------------------ |
||
18 | | Properties |
||
19 | | ------------------------------------------------------------------------------------------------ |
||
20 | */ |
||
21 | /** |
||
22 | * Specify if the form request is an ajax request. |
||
23 | * |
||
24 | * @var bool |
||
25 | */ |
||
26 | protected $ajaxRequest = false; |
||
27 | |||
28 | /** |
||
29 | * The errors format. |
||
30 | * |
||
31 | * @var string|null |
||
32 | */ |
||
33 | protected $errorsFormat = null; |
||
34 | |||
35 | /* ----------------------------------------------------------------- |
||
36 | | Main Methods |
||
37 | | ----------------------------------------------------------------- |
||
38 | */ |
||
39 | |||
40 | /** |
||
41 | * Get the proper failed validation response for the request. |
||
42 | * |
||
43 | * @param array $errors |
||
44 | * |
||
45 | * @return \Symfony\Component\HttpFoundation\Response |
||
46 | */ |
||
47 | public function response(array $errors) |
||
53 | |||
54 | /* ------------------------------------------------------------------------------------------------ |
||
55 | | Other Functions |
||
56 | | ------------------------------------------------------------------------------------------------ |
||
57 | */ |
||
58 | /** |
||
59 | * Format the json response. |
||
60 | * |
||
61 | * @param array $errors |
||
62 | * |
||
63 | * @return \Symfony\Component\HttpFoundation\Response |
||
64 | */ |
||
65 | protected function formatJsonErrorsResponse(array $errors) |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | protected function formatErrors(Validator $validator) |
||
92 | } |
||
93 |