'run function in every login in laravel fortify
I am using Laravel 8 with Fortify. I saved user's emails and passwords into the database and I'm not going to use registration.
Every time users log in, I need to check a value from another database and I did this by using the below function. My question is: How can I have this called every time after the user's login process?
private function check($user)
{
$url = "http://sitename.com/feedback/students/web/index.php?r=check&email={$user->email}";
$response = Http::get($url);
$user->update(['check' => array_values(json_decode($response->body(), true))[0]]);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|