registrierung wip
This commit is contained in:
1 parent
24871d41a9
commit
09bcc5e13e
9 files changed
+248
-181
No files matched your search
+12
-12
@@ -13,18 +13,18 @@ class Konto extends Model
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'gender',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'company',
|
||||
'address',
|
||||
'location',
|
||||
'code',
|
||||
'country',
|
||||
'kontoemail',
|
||||
'phone',
|
||||
'uid_number',
|
||||
'konto_title',
|
||||
'konto_gender',
|
||||
'konto_first_name',
|
||||
'konto_last_name',
|
||||
'konto_company',
|
||||
'konto_email',
|
||||
'konto_address',
|
||||
'konto_location',
|
||||
'konto_plz',
|
||||
'konto_country',
|
||||
'konto_phone',
|
||||
'konto_uid_number',
|
||||
];
|
||||
// protected static function booted(): void
|
||||
// {
|
||||
|
||||
+52
-21
@@ -26,28 +26,26 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'email',
|
||||
'konto_id',
|
||||
'password',
|
||||
'role',
|
||||
'super_admin',
|
||||
'app_verified_at',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'gender',
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'app_verified_at',
|
||||
|
||||
'title',
|
||||
'company',
|
||||
'address',
|
||||
'location',
|
||||
'code',
|
||||
'country',
|
||||
'kontoemail',
|
||||
'phone',
|
||||
'uid_number',
|
||||
'konto_title',
|
||||
'konto_gender',
|
||||
'konto_first_name',
|
||||
'konto_last_name',
|
||||
'konto_company',
|
||||
'konto_email',
|
||||
'konto_address',
|
||||
'konto_location',
|
||||
'konto_plz',
|
||||
'konto_country',
|
||||
'konto_phone',
|
||||
'konto_uid_number',
|
||||
'konto_agb_akzeptiert',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -85,9 +83,42 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
||||
|
||||
static::creating(function (User $user) {
|
||||
|
||||
// dd($user);
|
||||
if (isset($user->konto_title)) {
|
||||
|
||||
$user->role = 'gutachter';
|
||||
$konto = Konto::create([
|
||||
'konto_title' => $user->konto_title,
|
||||
'konto_gender' => $user->konto_gender,
|
||||
'konto_company' => $user->konto_company,
|
||||
'konto_uid_number' => $user->konto_uid_number,
|
||||
'konto_location' => $user->konto_location,
|
||||
'konto_plz' => $user->konto_plz,
|
||||
'konto_agb_akzeptiert' => $user->konto_agb_akzeptiert,
|
||||
'konto_country' => $user->konto_country,
|
||||
'konto_address' => $user->konto_address,
|
||||
'konto_first_name' => $user->konto_first_name,
|
||||
'konto_last_name' => $user->konto_last_name,
|
||||
'konto_email' => $user->konto_email,
|
||||
'konto_phone' => $user->konto_phone,
|
||||
]);
|
||||
$user->konto_id = $konto->id;
|
||||
|
||||
unset($user->konto_title);
|
||||
unset($user->konto_gender);
|
||||
unset($user->konto_company);
|
||||
unset($user->konto_uid_number);
|
||||
unset($user->konto_location);
|
||||
unset($user->konto_plz);
|
||||
unset($user->konto_agb_akzeptiert);
|
||||
unset($user->konto_country);
|
||||
unset($user->konto_address);
|
||||
unset($user->konto_first_name);
|
||||
unset($user->konto_last_name);
|
||||
unset($user->konto_email);
|
||||
unset($user->konto_phone);
|
||||
}
|
||||
$user->app_verified_at = now();
|
||||
$user->email_verified_at = now();
|
||||
$user->assignRole('gutachter');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user