Answer the question
In order to leave comments, you need to log in
What event to use or where is it necessary to get ip usera upon login?
I use the standard event Login from
'Illuminate\Auth\Events\Login' => [
'App\Listeners\LogSuccessfulLogin',
],
public function handle(Login $event)
{
Mail::to($event->user)->send(new UserLoginEmail($event->user));
}
function authenticated(Request $request, $user)
{
$user->update([
'last_login_ip' => $request->getClientIp()
]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question