1 | <?php |
||
20 | class AuthController extends Controller |
||
21 | { |
||
22 | /* |
||
23 | |-------------------------------------------------------------------------- |
||
24 | | Registration & Login Controller |
||
25 | |-------------------------------------------------------------------------- |
||
26 | | |
||
27 | | This controller handles the registration of new users, as well as the |
||
28 | | authentication of existing users. By default, this controller uses |
||
29 | | a simple trait to add these behaviors. Why don't you explore it? |
||
30 | | |
||
31 | */ |
||
32 | |||
33 | use AuthenticatesAndRegistersUsers { |
||
34 | postRegister as postRegisterOriginal; |
||
35 | postLogin as postLoginOriginal; |
||
36 | } |
||
37 | use ThrottlesLogins; |
||
38 | |||
39 | protected $redirectPath = "/"; |
||
40 | |||
41 | /** |
||
42 | * en = employee normal |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $custom = ['mode' => 'en']; |
||
46 | |||
47 | /** |
||
48 | * unique identifiers of the user |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $username = ['company_id', 'email']; |
||
52 | |||
53 | /** |
||
54 | * @var company |
||
55 | */ |
||
56 | private $company = null; |
||
57 | |||
58 | /** |
||
59 | * Create a new authentication controller instance. |
||
60 | * |
||
61 | */ |
||
62 | 15 | public function __construct() |
|
63 | { |
||
64 | 15 | config(['auth.model' => \plunner\Employee::class]); |
|
65 | 15 | config(['jwt.user' => \plunner\Employee::class]); |
|
66 | 15 | } |
|
67 | |||
68 | public function postRegister(Request $request) |
||
74 | |||
75 | 15 | public function postLogin(Request $request) |
|
95 | |||
96 | /** |
||
97 | * Get a validator for an incoming registration request. |
||
98 | * |
||
99 | * @param array $data |
||
100 | * @return \Illuminate\Contracts\Validation\Validator |
||
101 | */ |
||
102 | protected function validator(array $data) |
||
111 | |||
112 | /** |
||
113 | * Create a new user instance after a valid registration. |
||
114 | * |
||
115 | * @param array $data |
||
116 | * @return Company |
||
117 | */ |
||
118 | protected function create(array $data) |
||
126 | } |
||
127 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: