I have the following code which utilizes Laravel Passport:
if(Auth::attempt($input, true)) {
return \Auth::user()->createToken(Auth::user()->name, []);
}
So, when user logins every time, Laravel creates token over and over again. If this goes on happening, then database will overload for sure. Maybe I haven't yet understood how API Auth works.
Is there a way to prevent Laravel from doing this or is this what is to be expected?