Add all files

This commit is contained in:
root
2025-11-30 11:57:22 +01:00
parent 2ee51cac4f
commit 044271db3d
1476 changed files with 142544 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<?php
namespace App\Livewire\Auth;
use App\Attributes\DisabledIf;
use App\Livewire\ComponentWithProperties;
use App\Models\User;
use App\Traits\Captchable;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
#[DisabledIf('registration_disabled')]
class Register extends ComponentWithProperties
{
use Captchable;
public string $first_name = '';
public string $last_name = '';
public string $email = '';
public string $password = '';
public string $password_confirmation = '';
public function mount()
{
$this->initializeProperties(null, User::class);
}
public function rules()
{
return array_merge([
'first_name' => 'required|string|max:255',
'last_name' => 'required|string|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|string|min:8|confirmed',
], $this->getRulesForProperties());
}
public function submit()
{
$validatedData = $this->validate();
$user = User::create([
'first_name' => $this->first_name,
'last_name' => $this->last_name,
'email' => $this->email,
'password' => Hash::make($this->password),
]);
if (array_key_exists('properties', $validatedData)) {
$this->updateProperties($user, $validatedData['properties']);
}
Auth::login($user);
return $this->redirectIntended(route('dashboard'), true);
}
public function render()
{
return view('auth.register');
}
}