swop bookmaker and bookmaker mapper

This commit is contained in:
salam committed 2025-12-30 18:03:46 +01:00
1 parent 17acb27ef0
commit 7f7fc5c98f
10 files changed
+342 -67

No files matched your search

+12 -5
View File
@@ -20,10 +20,6 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, HasRoles, Notifiable;
protected $casts = [
'bettype_status' => 'json',
];
/**
* The attributes that are mass assignable.
*
@@ -36,10 +32,10 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
'password',
'agb_akzeptiert',
'app_verified_at',
'bettype_status',
'client_id',
'sport_id',
'bookmaker_id',
'bookmaker_mapper_id',
];
protected static function newFactory(): Factory
@@ -164,4 +160,15 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
{
return $this->hasMany(BettypeUser::class)->where('sport_id', auth()->user()->sport_id);
}
// Accessor
public function getUserBookmakerAttribute()
{
return $this->userBookmaker()->id ?? null;
}
public function userBookmaker()
{
return Bookmaker::where('id', auth()->user()->bookmaker_id)->select('id', 'name', 'icon', 'svg', 'txid')->first();
}
}