Initial commit of the L'Ami Fiduciaire SaaS platform built on Laravel 12, Vue 3, Inertia.js 2, and Tailwind CSS 4. Story 0.1 (rename folders to declarations in database) is implemented and code-reviewed: migration, rollback, and 6 Pest tests all passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
834 B
PHP
34 lines
834 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;
|
|
|
|
/**
|
|
* Validate and create a newly registered user.
|
|
*
|
|
* @param array<string, string> $input
|
|
*/
|
|
public function create(array $input): User
|
|
{
|
|
Validator::make($input, [
|
|
...$this->profileRules(),
|
|
'password' => $this->passwordRules(),
|
|
])->validate();
|
|
|
|
return User::create([
|
|
'name' => $input['name'],
|
|
'email' => $input['email'],
|
|
'password' => $input['password'],
|
|
]);
|
|
}
|
|
}
|