Dynamic form with multiple checkboxes/dropdowns for the weekdays when the shop is opened. Also, custom table columns to show opening times.
The main logic lives in our ShopResource
method form()
:
Repeater
field to create a dynamic form with multiple rowsRepeater
fieldlive()
fields (reactive fields) to enable/disable other fields based on the checkbox valueAnd for our Index, we are using a custom column Opening Times
:
app/Filament/Resources/ShopResource.php
class ShopResource extends Resource{ public static function form(Form $form): Form { return $form ->schema([ Forms\Components\TextInput::make('name') ->required() ->maxLength(255), // Simple new section to group fields Forms\Components\Section::make('Opening Times') ->schema([ // Repeater field with relationship to OpeningTime model Repeater::make('openingTimes') // ...