Download app/Actions/Fortify/CreateNewUser.php from lifedebugger/CAPS04-FE-REFACTOR-2: direct link, hf CLI and curl.
- Browser
- Download file 834 Bytes
-
https://huggingface.co/spaces/lifedebugger/CAPS04-FE-REFACTOR-2/resolve/main/app/Actions/Fortify/CreateNewUser.php
- Command line
-
hf download hf://spaces/lifedebugger/CAPS04-FE-REFACTOR-2/app/Actions/Fortify/CreateNewUser.php
-
curl -L -o CreateNewUser.php https://huggingface.co/spaces/lifedebugger/CAPS04-FE-REFACTOR-2/resolve/main/app/Actions/Fortify/CreateNewUser.php
834 Bytes
| 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'], | |
| ]); | |
| } | |
| } | |