Florin
Florin
FFilament
Created by Mike Peters on 2/17/2025 in #❓┊help
Autopopulate SelectFilter by table values?
is possible to move the table filters on the left side?
28 replies
FFilament
Created by Mike Peters on 2/17/2025 in #❓┊help
Autopopulate SelectFilter by table values?
``
28 replies
FFilament
Created by Mike Peters on 2/17/2025 in #❓┊help
Autopopulate SelectFilter by table values?
how to do that?
28 replies
FFilament
Created by Mike Peters on 2/17/2025 in #❓┊help
Autopopulate SelectFilter by table values?
I ve tried it like this, but there is no query executed when form is selected
28 replies
FFilament
Created by Mike Peters on 2/17/2025 in #❓┊help
Autopopulate SelectFilter by table values?
also An attempt was made to evaluate a closure for [Filament\Tables\Filters\SelectFilter], but [$get] was unresolvable.
28 replies
FFilament
Created by Mike Peters on 2/17/2025 in #❓┊help
Autopopulate SelectFilter by table values?
Yes, but there is no live method or disabled on table SelectFIlter
28 replies
FFilament
Created by Mike Peters on 2/17/2025 in #❓┊help
Autopopulate SelectFilter by table values?
I ve tried something like this "Filter::make('vehicle_filter') ->form([ Select::make('make_id') ->label('Marca') ->options(fn() => Stock::with('make') ->selectRaw('make_id, COUNT() as count') ->groupBy('make_id') ->get() ->mapWithKeys(fn($item) => [ $item->make_id => optional($item->make)->name . " ({$item->count})" ]) ->toArray() ) ->multiple() ->searchable(), Select::make('model') ->label('Model') ->options(fn(callable $get) => Stock::when(filled($get('make_id')), fn($query) => $query->whereIn('make_id', $get('make_id')) ) ->selectRaw('model, COUNT() as count') ->groupBy('model') ->get() ->mapWithKeys(fn($item) => [$item->model => "{$item->model} ({$item->count})"]) ->toArray() ) ->multiple() ->searchable(), ]) ->query(function (Builder $query, array $data): Builder { return $query ->when(!empty($data['make_id']), fn($query) => $query->whereIn('make_id', $data['make_id'])) ->when(!empty($data['model']), fn($query) => $query->whereIn('model', $data['model'])); });" but the query is not being executed
28 replies
FFilament
Created by Mike Peters on 2/17/2025 in #❓┊help
Autopopulate SelectFilter by table values?
and I want the model to be from the make_id, this is on tables
28 replies
FFilament
Created by Mike Peters on 2/17/2025 in #❓┊help
Autopopulate SelectFilter by table values?
Yes but is not a relationship, basicly i want to be able to select the second filter dependent on the first one, I have the fallowing "SelectFilter::make('make_id') ->label('Marca') ->options(fn() => Stock::with('make') ->selectRaw('make_id, COUNT() as count') ->groupBy('make_id') ->get() ->mapWithKeys(fn($item) => [$item->make_id => optional($item->make)->name." ({$item->count})"]) ->toArray() ) ->multiple() ->searchable(), SelectFilter::make('model') ->label('Model') ->options(fn() => Stock::selectRaw('model, COUNT() as count') ->groupBy('model') ->get() ->mapWithKeys(fn($item) => [$item->model => "{$item->model} ({$item->count})"]) ->toArray() ) ->multiple() ->searchable(),"
28 replies