From 1b1523ce47b80e22e95f0ffeaaee9882a3e15cb9 Mon Sep 17 00:00:00 2001 From: Moh Ravi Dwi Putra Date: Sun, 30 Jan 2022 23:02:33 +0700 Subject: [PATCH] :art: Update Unit Testing And Model --- app/Models/User.php | 2 +- database/factories/UserFactory.php | 2 +- resources/lang/en/auth.php | 3 ++- resources/lang/id/auth.php | 3 ++- resources/views/auth/register.blade.php | 24 ++++++++++++++++++++++++ tests/Feature/AuthenticationTest.php | 2 +- 6 files changed, 31 insertions(+), 5 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index b2c953a8..a4d600a5 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -19,7 +19,7 @@ class User extends Authenticatable */ protected $fillable = [ 'name', - // 'email', + 'email', 'username', 'password', 'created_by', diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index d7097eca..3b50eb4d 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -28,7 +28,7 @@ public function definition() 'username' => $this->faker->userName, // 'email' => $this->faker->unique()->safeEmail(), 'email_verified_at' => now(), - 'password' => Hash::make('password'), + 'password' => Hash::make('password'), // password 'remember_token' => Str::random(10), ]; } diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index 0943e4bb..4a8c3b3f 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -26,6 +26,7 @@ 'register' => 'Register', 'username' => 'Username', 'password' => 'Password', + 'phone' => 'Phone', 'changePassword' => 'Change Password', 'terms' => 'I agree with the terms and conditions' -]; +]; \ No newline at end of file diff --git a/resources/lang/id/auth.php b/resources/lang/id/auth.php index 75d042fb..76557c49 100644 --- a/resources/lang/id/auth.php +++ b/resources/lang/id/auth.php @@ -26,6 +26,7 @@ 'register' => 'Daftar', 'username' => 'Nama Pengguna', 'password' => 'Kata Sandi', + 'phone' => 'No Telepon', 'changePassword' => 'Ganti Kata Sandi', 'terms' => 'Saya setuju dengan syarat dan ketentuan' -]; +]; \ No newline at end of file diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index a28b611c..29410a42 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -36,6 +36,30 @@ @enderror +
+
+
+ +
+ + @error('email') +
+ {{ $message }} +
+ @enderror +
+
+ + + @error('phone') +
+ {{ $message }} +
+ @enderror +
+
+
diff --git a/tests/Feature/AuthenticationTest.php b/tests/Feature/AuthenticationTest.php index bee0b3f8..130f5165 100644 --- a/tests/Feature/AuthenticationTest.php +++ b/tests/Feature/AuthenticationTest.php @@ -44,4 +44,4 @@ public function test_users_can_not_authenticate_with_invalid_password() $this->assertGuest(); } -} +} \ No newline at end of file