Filter::make('xxxx') ->form([ Select::make('user_id') ->options([ 1 => 'a', 2 => 'b' ]) ->reactive(), Select::make('another_id') ->options(fn ($get) => Model::whereIn('user_id', $get('user_id'))->pluck('name', 'id')) ]) ->query(function (Builder $query, array $data): Builder { // your filter query })
Repeater::make('sales') ->schema([ Select::make('item') ->options(MdPriceList::pluck('material_number', 'id')) ->reactive() ->required() ->afterStateUpdated(fn ($state, callable $set) => $set('price', number_format(MdPriceList::find($state)?->amount) ?? 0)) ->searchable(), TextInput::make('price') ->reactive(), ]) ->disableItemMovement() ->columns(2),Placeholder::make('total') ->content(function ($get) { $contet = collect($get('sales'))->map(function ($item) { return [ 'price' => $item['price'] ? Str::remove(',', $item['price']) : 0, ]; })->sum('price'); return number_format($contet, 2); }),
<div class="p-5"> <x-filament::button wire:click="toggle" class="text-right"> Show / Hide Header Action </x-filament::button> <div class="mt-4"> Header Action : {{ $showHeaderActionsButton ? 'Hidden (true)' : 'Hidden (false)' }} </div> <div class="mt-4"> {{ $this->table }} </div></div>