mapping provider menu wip
This commit is contained in:
1 parent
ed54d9f8e4
commit
0c35fa0ebc
9 files changed
+55
-21
No files matched your search
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\Clients\Schemas;
|
||||
|
||||
use App\Models\Bookmaker;
|
||||
use App\Models\Provider;
|
||||
use App\Models\Sport;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
@@ -23,6 +24,11 @@ class ClientForm
|
||||
->multiple()
|
||||
->preload()
|
||||
->searchable(),
|
||||
Select::make('provider')
|
||||
->options(Provider::query()->pluck('name', 'id'))
|
||||
->multiple()
|
||||
->preload()
|
||||
->searchable(),
|
||||
Select::make('sport')
|
||||
->options(Sport::query()->pluck('name', 'id'))
|
||||
->multiple()
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Filament\Resources\Clients\Tables;
|
||||
use App\Actions\AlarmGenerator;
|
||||
use App\Actions\MultilineGenerator;
|
||||
use App\Models\Bookmaker;
|
||||
use App\Models\Provider;
|
||||
use App\Models\Sport;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\EditAction;
|
||||
@@ -20,20 +21,21 @@ class ClientsTable
|
||||
->columns([
|
||||
TextColumn::make('name'),
|
||||
TextColumn::make('bookmaker')
|
||||
->wrap()
|
||||
->badge()
|
||||
->formatStateUsing(fn (string $state): string => Bookmaker::where('id', $state)->pluck('name')->first()),
|
||||
TextColumn::make('provider')
|
||||
->badge()
|
||||
->wrap()
|
||||
->color('success')
|
||||
->formatStateUsing(fn (string $state): string => Provider::where('id', $state)->pluck('name')->first()),
|
||||
TextColumn::make('sport')
|
||||
->badge()
|
||||
->wrap()
|
||||
->color('warning')
|
||||
->formatStateUsing(fn (string $state): string => Sport::where('id', $state)->pluck('name')->first()),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('created_at')->dateTime(),
|
||||
TextColumn::make('updated_at')->dateTime(),
|
||||
])
|
||||
->recordActions([
|
||||
Action::make('multiline')
|
||||
|
||||
@@ -21,7 +21,10 @@ class UsersTable
|
||||
->searchable(),
|
||||
TextColumn::make('client.name')->badge(),
|
||||
TextColumn::make('roles.name')->badge()->color('success')->wrap(),
|
||||
TextColumn::make('bookmaker.name')->badge()->color('warning'),
|
||||
TextColumn::make('bookmaker.name')
|
||||
->label('Active Bookmaker')
|
||||
->badge()
|
||||
->color('warning'),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
@@ -8,6 +8,7 @@ class Client extends Model
|
||||
{
|
||||
protected $casts = [
|
||||
'bookmaker' => 'json',
|
||||
'provider' => 'json',
|
||||
'sport' => 'json',
|
||||
];
|
||||
|
||||
@@ -15,6 +16,7 @@ class Client extends Model
|
||||
'name',
|
||||
'homepage',
|
||||
'bookmaker',
|
||||
'provider',
|
||||
'sport',
|
||||
];
|
||||
}
|
||||
Reference in new issue
Block a user