- Fix root cause: recipes_spices.amount_in_percent was decimal(4,2) which overflows on 100% — widened to decimal(6,2) via migration - Wrap afterSave() in try-catch so DB/logic errors show as a persistent danger notification instead of a blank 500 page - Same for CreateProduct: errors show as notification; also reads recipe_spices from raw Livewire $this->data (not $data param which excludes dehydrated(false) fields) so recipes actually save on create Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
811f5a015e
commit
3301a1e9b2
3 files changed
+77
-31
No files matched your search
@@ -51,8 +51,17 @@ class EditProduct extends EditRecord
|
||||
|
||||
protected function afterSave(): void
|
||||
{
|
||||
$this->syncSizes();
|
||||
$this->syncRecipe();
|
||||
try {
|
||||
$this->syncSizes();
|
||||
$this->syncRecipe();
|
||||
} catch (\Throwable $e) {
|
||||
Notification::make()
|
||||
->title('Fehler beim Speichern')
|
||||
->body($e->getMessage())
|
||||
->danger()
|
||||
->persistent()
|
||||
->send();
|
||||
}
|
||||
}
|
||||
|
||||
protected function syncSizes(): void
|
||||
|
||||
Reference in new issue
Block a user