This commit is contained in:
salam committed 2026-02-03 18:41:19 +01:00
1 parent 368af4b565
commit aba3a87745
9 files changed
+142 -95

No files matched your search

@@ -76,7 +76,8 @@ class EventsTable
->tooltip(fn ($record) => $record->id)
->visibleFrom('lg'),
MatchIds::make('ids')->grow(false)->visibleFrom('xl'),
MatchIds::make('ids')->grow(false)->visibleFrom('xl')
->visible(fn () => auth()->user()->hasRole('super_admin')),
TextColumn::make('starttime')
->label('Start')
@@ -4,9 +4,13 @@ namespace App\Filament\Resources\Users\Schemas;
use App\Models\Bookmaker;
use App\Models\Client;
use Filament\Forms\Components\Hidden;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rules\Password;
class UserForm
{
@@ -14,40 +18,74 @@ class UserForm
{
return $schema
->components([
TextInput::make('name')
->required(),
TextInput::make('email')
->label('Email address')
->email()
->required(),
Select::make('client_id')
->relationship('client', 'name')
->preload(),
Select::make('roles')
->label('Rollen')
->prefixIcon('phosphor-gear')
->aboveContent('Only visible for super_admin')
Hidden::make('email_verified_at')->default(now()),
Section::make('User Details')
->columnSpanFull()
->columns(2)
->schema([
TextInput::make('name')
->columns(1)
->required(),
TextInput::make('email')
->label('Email address')
->email()
->required(),
TextInput::make('password')
->password()
->revealable()
->dehydrated(fn ($state): bool => filled($state))
->dehydrateStateUsing(fn ($state): string => Hash::make($state))
->same('password_confirmation')
->rule(Password::min(8)
->mixedCase()
->numbers()
->symbols()
->uncompromised())
->label('Password'),
TextInput::make('password_confirmation')
->password()
->dehydrated(false)
->same('password')
->revealable(),
]),
Section::make('Bookmaker Configuration')
->columnSpanFull()
->columns(2)
->schema([
Select::make('client_id')
->relationship('client', 'name')
->preload(),
Select::make('bookmaker_id')
->label('Active Bookmaker')
->options(fn () => Bookmaker::query()->where('is_client', 1)->pluck('name', 'id'))
->preload(),
Select::make('partner_bookmaker_id')
->label('Partner Bookmaker')
->options(function () {
$bookmaker = Client::where('id', auth()->user()->client_id)->value('bookmaker');
return Bookmaker::query()->whereIn('id', $bookmaker)->pluck('name', 'id');
})
->preload(),
Select::make('provider_id')
->relationship('provider', 'name')
->preload(),
]),
Section::make('Authorisations')
->visible(fn () => auth()->user()->hasRole('super_admin'))
->relationship('roles', 'name')
->multiple()
->preload()
->searchable(),
Select::make('bookmaker_id')
->label('Active Bookmaker')
->options(function () {
$bookmaker = Client::where('id', auth()->user()->client_id)->value('bookmaker');
return Bookmaker::query()->whereIn('id', $bookmaker)->pluck('name', 'id');
})
->preload(),
Select::make('partner_bookmaker_id')
->label('Partner Bookmaker')
->options(function () {
$bookmaker = Client::where('id', auth()->user()->client_id)->value('bookmaker');
return Bookmaker::query()->whereIn('id', $bookmaker)->pluck('name', 'id');
})
->preload(),
->columnSpanFull()
->schema([
Select::make('roles')
->label('Rollen')
->prefixIcon('phosphor-gear')
->aboveContent('Only visible for super_admin')
->visible(fn () => auth()->user()->hasRole('super_admin'))
->relationship('roles', 'name')
->multiple()
->preload()
->searchable(),
]),
]);
}
}
+4 -4
View File
@@ -270,15 +270,15 @@ class TooltipOdds extends Column
if ($this->size > $this->two_cols_break) {
if ($columns == 6) {
$part = '<div class="grid grid-cols-15 gap-2 m-5 mt-1 z-100 text-xs text-center striped">';
$part = '<div class="grid grid-cols-15 gap-2 m-5 mt-1 z-100 text-xs text-center">';
} else {
$part = '<div class="grid grid-cols-13 gap-2 m-5 mt-1 z-100 text-xs text-center striped">';
$part = '<div class="grid grid-cols-13 gap-2 m-5 mt-1 z-100 text-xs text-center">';
}
} else {
if ($columns == 6) {
$part = '<div class="grid grid-cols-7 gap-2 m-5 mt-1 z-100 text-xs text-center striped">';
$part = '<div class="grid grid-cols-7 gap-2 m-5 mt-1 z-100 text-xs text-center">';
} else {
$part = '<div class="grid grid-cols-6 gap-2 m-5 mt-1 z-100 text-xs text-center striped">';
$part = '<div class="grid grid-cols-6 gap-2 m-5 mt-1 z-100 text-xs text-center">';
}
}
$part .= '<div class="col-span-full text-center text-md font-bold mb-2">'.$title.'</div>';
+5
View File
@@ -151,6 +151,11 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
return false;
}
public function provider()
{
return $this->belongsTo(Provider::class);
}
public function client()
{
return $this->belongsTo(Client::class);