| 1 | <?php namespace Arcanedev\Support\Http; |
||
| 11 | abstract class FormRequest extends BaseFormRequest |
||
| 12 | { |
||
| 13 | /* ----------------------------------------------------------------- |
||
| 14 | | Main Methods |
||
| 15 | | ----------------------------------------------------------------- |
||
| 16 | */ |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Determine if the user is authorized to make this request. |
||
| 20 | * |
||
| 21 | * @return bool |
||
| 22 | */ |
||
| 23 | public function authorize() |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Get the validation rules that apply to the request. |
||
| 30 | * |
||
| 31 | * @return array |
||
| 32 | */ |
||
| 33 | abstract public function rules(); |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Prepare the data for validation. |
||
| 37 | */ |
||
| 38 | 6 | protected function prepareForValidation() |
|
| 44 | } |
||
| 45 |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: