TextInputColumn custom validation error

Tables\Columns\TextInputColumn::make('baseShopItem.discount_price') ->label(__('validation.attributes.discount_price')) ->toggleable() ->rules([ fn (Forms\Get $get): \Closure => function (string $attribute, $value, \Closure $fail) use ($get) { if ($get('baseShopItem.price') > $value) { $fail("The {$attribute} is invalid."); } }, ]) ->extraInputAttributes(['class' => 'min-w-[68px]']), i am getting. App\Filament\Resources{closure}(): Argument #1 ($get) must be of type Filament\Forms\Get, string given
2 Replies
Dennis Koch
Dennis Koch20h ago
You cannot use $get in a table. There is no form. Isn't the value injected through $state or $value maybe?
monzer
monzerOP13h ago
The value is injected thats not the issue. I need to get the value of another text input column.

Did you find this page helpful?