1 | <?php namespace Arcanesoft\Auth\Http\Requests\Backend\Users; |
||
12 | class UpdateUserRequest extends FormRequest |
||
13 | { |
||
14 | /* ------------------------------------------------------------------------------------------------ |
||
15 | | Properties |
||
16 | | ------------------------------------------------------------------------------------------------ |
||
17 | */ |
||
18 | /** |
||
19 | * Role validation rules. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $rules = [ |
||
24 | 'username' => 'required|min:3', |
||
25 | 'email' => 'required|email', |
||
26 | 'first_name' => 'required|min:2', |
||
27 | 'last_name' => 'required|min:2', |
||
28 | 'password' => 'required_with:password_confirmation|min:8|confirmed', |
||
29 | 'password_confirmation' => 'required_with:password|min:8', |
||
30 | 'roles' => 'required|array|min:1', |
||
31 | ]; |
||
32 | |||
33 | /* ------------------------------------------------------------------------------------------------ |
||
34 | | Main Functions |
||
35 | | ------------------------------------------------------------------------------------------------ |
||
36 | */ |
||
37 | /** |
||
38 | * Determine if the user is authorized to make this request. |
||
39 | * |
||
40 | * @return bool |
||
41 | */ |
||
42 | public function authorize() |
||
46 | |||
47 | /** |
||
48 | * Get the validation rules that apply to the request. |
||
49 | * |
||
50 | * @return array |
||
51 | */ |
||
52 | public function rules() |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | public function all() |
||
74 | |||
75 | /* ------------------------------------------------------------------------------------------------ |
||
76 | | Other Functions |
||
77 | | ------------------------------------------------------------------------------------------------ |
||
78 | */ |
||
79 | /** |
||
80 | * Get the role ids. |
||
81 | * |
||
82 | * @return \Illuminate\Database\Eloquent\Collection |
||
83 | */ |
||
84 | private function getRoleIds() |
||
90 | } |
||
91 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: