Stock by size and color, in one field.From this code.
Filament has no row × column field. Warp Matrix gives you a grid where each row meets each column once, with totals that follow what you type.
Your code One form field
Matrix::make('stock') ->rows(Size::class, label: 'name') ->columns(Color::class, label: 'name') ->relationship( 'stocks', row: 'size_id', column: 'color_id', value: 'quantity', ) ->numeric(min: 0) ->totals()
- ✓Type like a spreadsheet, or paste a range from Excel
- ✓Rows and columns come from your own models
- ✓Each filled cell is one row of your stocks table
The picture is this demo's "Stock by size and color" page, which adds a hint, a Copy table button and a product form around the field.