36 lines
951 B
PHP
36 lines
951 B
PHP
<?php
|
|
|
|
namespace App\Filament\Pages\Auth;
|
|
|
|
use Filament\Pages\Auth\Register as BaseRegister;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Register extends BaseRegister
|
|
{
|
|
public ?array $data = [];
|
|
|
|
protected function handleRegistration(array $data): Model
|
|
{
|
|
$user = parent::handleRegistration($data);
|
|
$user->assignRole('mahasiswa');
|
|
return $user;
|
|
}
|
|
|
|
protected function getForms(): array
|
|
{
|
|
return [
|
|
'form' => $this->form(
|
|
$this->makeForm()
|
|
->schema([
|
|
$this->getNameFormComponent(),
|
|
$this->getEmailFormComponent(),
|
|
$this->getPasswordFormComponent(),
|
|
$this->getPasswordConfirmationFormComponent(),
|
|
])
|
|
->statePath('data'),
|
|
),
|
|
];
|
|
}
|
|
} |