1 | <?php |
||
9 | trait AuthenticatesUsers |
||
10 | { |
||
11 | use ThrottlesLogins; |
||
12 | |||
13 | /** |
||
14 | * Send the response after the user was authenticated. |
||
15 | * |
||
16 | * @param \Illuminate\Http\Request $request |
||
17 | * |
||
18 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
19 | */ |
||
20 | protected function sendLoginResponse(Request $request) |
||
52 | |||
53 | /** |
||
54 | * Get the failed login response instance. |
||
55 | * |
||
56 | * @param \Illuminate\Http\Request $request |
||
57 | * |
||
58 | * @throws ValidationException |
||
59 | * |
||
60 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
61 | */ |
||
62 | protected function sendFailedLoginResponse(Request $request) |
||
68 | |||
69 | /** |
||
70 | * Redirect the user after determining they are locked out. |
||
71 | * |
||
72 | * @param \Illuminate\Http\Request $request |
||
73 | * |
||
74 | * @throws \Illuminate\Validation\ValidationException |
||
75 | * |
||
76 | * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
77 | */ |
||
78 | protected function sendLockoutResponse(Request $request) |
||
88 | |||
89 | /** |
||
90 | * Process logout. |
||
91 | * |
||
92 | * @param \Illuminate\Http\Request $request |
||
93 | * |
||
94 | * @return void |
||
95 | */ |
||
96 | protected function processLogout(Request $request): void |
||
102 | |||
103 | /** |
||
104 | * Get the login username to be used by the controller. |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | protected function username() |
||
112 | } |
||
113 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.