Skip to content

Commit

Permalink
🎨 Update Unit Testing And Model
Browse files Browse the repository at this point in the history
  • Loading branch information
rdp77 committed Jan 30, 2022
1 parent 559f8a8 commit 1b1523c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class User extends Authenticatable
*/
protected $fillable = [
'name',
// 'email',
'email',
'username',
'password',
'created_by',
Expand Down
2 changes: 1 addition & 1 deletion database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
];
}
Expand Down
3 changes: 2 additions & 1 deletion resources/lang/en/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'register' => 'Register',
'username' => 'Username',
'password' => 'Password',
'phone' => 'Phone',
'changePassword' => 'Change Password',
'terms' => 'I agree with the terms and conditions'
];
];
3 changes: 2 additions & 1 deletion resources/lang/id/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
];
];
24 changes: 24 additions & 0 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,30 @@
@enderror
</div>

<div class="row">
<div class="form-group col-6">
<div class="d-block">
<label for="email" class="control-label">{{ __('Email') }}</label>
</div>
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email"
tabindex="3" required autocomplete="email">
@error('email')
<div class="invalid-feedback">
{{ $message }}
</div>
@enderror
</div>
<div class="form-group col-6">
<label for="phone" class="control-label">{{ __('auth.phone') }}</label>
<input id="phone" type="text" class="form-control" name="phone" required>
@error('phone')
<div class="invalid-feedback">
{{ $message }}
</div>
@enderror
</div>
</div>

<div class="row">
<div class="form-group col-6">
<div class="d-block">
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/AuthenticationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ public function test_users_can_not_authenticate_with_invalid_password()

$this->assertGuest();
}
}
}

0 comments on commit 1b1523c

Please sign in to comment.