multilines wip
This commit is contained in:
1 parent
218c1e6e1c
commit
825a8d430c
19 files changed
+145
-78
No files matched your search
@@ -7,7 +7,10 @@ use Filament\Actions\Action;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class MultilinesTable
|
||||
{
|
||||
@@ -20,6 +23,7 @@ class MultilinesTable
|
||||
->label($isReordering ? 'Disable reordering' : 'Enable reordering'),
|
||||
)
|
||||
->reorderable('sort')
|
||||
->defaultGroup('bettype.name')
|
||||
->columns([
|
||||
IconColumn::make('sport.icon')
|
||||
->label('')
|
||||
@@ -33,16 +37,25 @@ class MultilinesTable
|
||||
TextColumn::make('bookmaker.name'),
|
||||
BookmakerIcon::make('bookmaker.icon')->label('Icon'),
|
||||
])
|
||||
->defaultSort('sort')
|
||||
->deferFilters(false)
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
SelectFilter::make('sport_id')
|
||||
->label('Sport')
|
||||
->default(1)
|
||||
->selectablePlaceholder(false)
|
||||
->relationship('sport', 'name', fn (Builder $query) => $query->where('is_active', 1))
|
||||
->preload(),
|
||||
], FiltersLayout::AboveContent)
|
||||
->hiddenFilterIndicators()
|
||||
->persistFiltersInSession()
|
||||
->recordActions([
|
||||
EditAction::make()
|
||||
->mutateDataUsing(function (array $data): array {
|
||||
$data['client_id'] = auth()->user()->client_id;
|
||||
// EditAction::make()
|
||||
// ->mutateDataUsing(function (array $data): array {
|
||||
// $data['client_id'] = auth()->user()->client_id;
|
||||
|
||||
return $data;
|
||||
}),
|
||||
// return $data;
|
||||
// }),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user