In an action’s modal
The button opens a modal with the stock of the Oxford shirt, saved in the stocks table like on its edit page. A plain Action needs ->fillForm(fn ($record) => $record->attributesToArray()) so that the matrix reads the rows of the record (EditAction does this by itself).
Note: Try it
Click “Edit the stock of the Oxford shirt”, change L × Navy to 30 and click Submit. Then click “Open its edit page”: L × Navy is 30 there too.
In each item of a repeater
Each color of the shirt has its own price table. The prices are saved inside the item, next to its name.
Note: Try it
Click “Add color”, name it Navy and type a price in 1+ × Retail. Click “Show what would be saved”: the new item has its own prices.
-
PricesQuantityRetailMember1+10+
Leave it empty and press Enter to clear the cells.
-
PricesQuantityRetailMember1+10+
Leave it empty and press Enter to clear the cells.