From a27c1c40541aabf6cc18152fc74127061a7ba440 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 2 Jun 2020 21:30:33 +0200 Subject: [PATCH] save last login timestamp at registration #27 --- app/Http/Controllers/Auth/RegisterController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 18ed614..c95d6e4 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -5,6 +5,7 @@ use App\Http\Controllers\Controller; use App\Providers\RouteServiceProvider; use App\User; +use Carbon\Carbon; use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; @@ -44,7 +45,7 @@ public function __construct() /** * Get a validator for an incoming registration request. * - * @param array $data + * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) @@ -59,7 +60,7 @@ protected function validator(array $data) /** * Create a new user instance after a valid registration. * - * @param array $data + * @param array $data * @return \App\User */ protected function create(array $data) @@ -68,6 +69,7 @@ protected function create(array $data) 'username' => $data['username'], 'email' => $data['email'], 'password' => Hash::make($data['password']), + 'last_login' => Carbon::now() ]); } }