Some checks failed
tests / ci (pull_request) Has been cancelled
- Changed user creation to use 'username' instead of 'name'. - Added UserProfile model with relationships to User and gender enum. - Updated validation rules for username and email. - Modified migrations to create user_profiles table and adjust users table. - Updated seeder to create users with profiles. - Translated various UI texts to Indonesian and improved layout components.
29 lines
722 B
PHP
29 lines
722 B
PHP
<?php
|
|
|
|
namespace App\Actions\Fortify;
|
|
|
|
use App\Concerns\PasswordValidationRules;
|
|
use App\Concerns\ProfileValidationRules;
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Laravel\Fortify\Contracts\CreatesNewUsers;
|
|
|
|
class CreateNewUser implements CreatesNewUsers
|
|
{
|
|
use PasswordValidationRules, ProfileValidationRules;
|
|
|
|
public function create(array $input): User
|
|
{
|
|
Validator::make($input, [
|
|
...$this->profileRules(),
|
|
'password' => $this->passwordRules(),
|
|
])->validate();
|
|
|
|
return User::create([
|
|
'username' => $input['username'],
|
|
'email' => $input['email'],
|
|
'password' => $input['password'],
|
|
]);
|
|
}
|
|
}
|