Update last_seen when logging in

Update last_seen when logging in
This commit is contained in:
Dennis 2022-08-18 08:27:48 +02:00 committed by GitHub
commit 04ed457570
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,9 +3,12 @@
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
class LoginController extends Controller
{
@ -66,6 +69,9 @@ class LoginController extends Controller
}
if ($this->attemptLogin($request)) {
$user = Auth::user();
$user->last_seen = now();
$user->save();
return $this->sendLoginResponse($request);
}