Update Module User

- Add Nik and branch,
This commit is contained in:
Daeng Deni Mardaeni
2024-08-27 14:45:50 +07:00
parent 18f0f68f1a
commit d3baaa31c1
8 changed files with 121 additions and 15 deletions

View File

@@ -20,13 +20,15 @@
public function rules()
: array
{
$rules = [
'name' => 'required|string|max:255',
'name' => 'required|string|max:255',
'nik' => 'nullable|string|max:6|unique:users,nik',
'branch_id' => 'nullable|exists:branches,id',
'profile_photo_path' => 'nullable|image|mimes:jpeg,png,jpg|max:2048',
];
if ($this->password || $this->method() === 'POST') {
$rules['email'] = 'required|email|unique:users,email';
$rules['email'] = 'required|email|unique:users,email';
$rules['password'] = 'required|string|min:8|confirmed';
}
@@ -40,7 +42,7 @@
public function passedValidation()
{
$this->merge([
'password' => Hash::make($this->password)
'password' => Hash::make($this->password),
]);
}
}