1 | <?php |
||
21 | class AuthController extends Controller |
||
22 | { |
||
23 | /* |
||
24 | |-------------------------------------------------------------------------- |
||
25 | | Registration & Login Controller |
||
26 | |-------------------------------------------------------------------------- |
||
27 | | |
||
28 | | This controller handles the registration of new users, as well as the |
||
29 | | authentication of existing users. By default, this controller uses |
||
30 | | a simple trait to add these behaviors. Why don't you explore it? |
||
31 | | |
||
32 | */ |
||
33 | |||
34 | use AuthenticatesAndRegistersUsers{ |
||
35 | postRegister as postRegisterOriginal; |
||
36 | postLogin as postLoginOriginal; |
||
37 | } |
||
38 | use ThrottlesLogins; |
||
39 | |||
40 | protected $redirectPath = "/"; |
||
41 | |||
42 | /** |
||
43 | * en = employee normal |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $custom = ['mode'=>'en']; |
||
47 | |||
48 | /** |
||
49 | * @var company |
||
50 | */ |
||
51 | private $company = null; |
||
52 | |||
53 | /** |
||
54 | * Create a new authentication controller instance. |
||
55 | * |
||
56 | */ |
||
57 | 10 | public function __construct() |
|
58 | { |
||
59 | 10 | config(['auth.model' => \plunner\Employee::class]); |
|
60 | 10 | config(['jwt.user' => \plunner\Employee::class]); |
|
61 | 10 | } |
|
62 | |||
63 | /** |
||
64 | * Get a validator for an incoming registration request. |
||
65 | * |
||
66 | * @param array $data |
||
67 | * @return \Illuminate\Contracts\Validation\Validator |
||
68 | */ |
||
69 | protected function validator(array $data) |
||
77 | |||
78 | /** |
||
79 | * Create a new user instance after a valid registration. |
||
80 | * |
||
81 | * @param array $data |
||
82 | * @return Company |
||
83 | */ |
||
84 | protected function create(array $data) |
||
92 | |||
93 | public function postRegister(Request $request) |
||
99 | |||
100 | |||
101 | 10 | public function postLogin(Request $request) |
|
119 | } |
||
120 |
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: