From 6269ba1a550b8ccea995fa49762d9e87910068af Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Tue, 7 Feb 2023 17:02:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Web/Auth/RegisterController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Web/Auth/RegisterController.php b/app/Http/Controllers/Web/Auth/RegisterController.php index c02e0db..b1b5fec 100644 --- a/app/Http/Controllers/Web/Auth/RegisterController.php +++ b/app/Http/Controllers/Web/Auth/RegisterController.php @@ -17,7 +17,7 @@ class RegisterController extends Controller |-------------------------------------------------------------------------- | | This controller handles the registration of new users as well as their - | validation and creation. By default this controller uses a trait to + | validation and creation. By default, this controller uses a trait to | provide this functionality without requiring any additional code. | */ @@ -47,7 +47,7 @@ public function __construct() * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ - protected function validator(array $data) + protected function validator(array $data): \Illuminate\Contracts\Validation\Validator { return Validator::make($data, [ 'name' => ['required', 'string', 'max:255'], @@ -60,11 +60,11 @@ protected function validator(array $data) * Create a new user instance after a valid registration. * * @param array $data - * @return \App\Models\User + * @return User */ - protected function create(array $data) + protected function create(array $data): User { - return User::create([ + return (new User)->create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => Hash::make($data['password']),