wip
This commit is contained in:
1 parent
5f95289079
commit
60249dffd9
37 files changed
+412
-458
No files matched your search
@@ -40,8 +40,8 @@ class Konto extends Model
|
||||
return KontoFactory::new();
|
||||
}
|
||||
|
||||
public function konto_option(): HasOne
|
||||
public function plan(): HasOne
|
||||
{
|
||||
return $this->hasOne(KontoOption::class, 'id', 'konto_option_id');
|
||||
return $this->hasOne(Plan::class);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
class KontoOption extends Model
|
||||
{
|
||||
public function payment_plan(): HasOne
|
||||
{
|
||||
return $this->hasOne(PaymentPlan::class, 'id', 'payment_plan_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Plan extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
+49
-50
@@ -3,13 +3,16 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Scopes\KontoScope;
|
||||
use Database\Factories\UserFactory;
|
||||
use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthentication;
|
||||
use Filament\Auth\MultiFactor\App\Contracts\HasAppAuthenticationRecovery;
|
||||
use Filament\Auth\MultiFactor\Email\Contracts\HasEmailAuthentication;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Panel;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@@ -32,22 +35,13 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
||||
'email',
|
||||
'password',
|
||||
'app_verified_at',
|
||||
|
||||
'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',
|
||||
];
|
||||
|
||||
protected static function newFactory(): Factory
|
||||
{
|
||||
return UserFactory::new();
|
||||
}
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
@@ -81,45 +75,50 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
||||
{
|
||||
static::addGlobalScope(new KontoScope);
|
||||
|
||||
static::creating(function (User $user) {
|
||||
// static::creating(function (User $user) {
|
||||
|
||||
if (isset($user->konto_title)) {
|
||||
// if (isset($user->konto_title)) {
|
||||
|
||||
$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;
|
||||
// $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');
|
||||
});
|
||||
// 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');
|
||||
// });
|
||||
}
|
||||
|
||||
public function konto(): HasOne
|
||||
{
|
||||
return $this->hasOne(Konto::class, 'id', 'konto_id');
|
||||
}
|
||||
|
||||
public function getAppAuthenticationSecret(): ?string
|
||||
|
||||
Reference in new issue
Block a user