13-05-2026 Waren Wirtschaft

This commit is contained in:
Kevin Adametz 2026-05-13 18:09:20 +02:00
parent 9ce711d6b2
commit ca3eb663fe
40 changed files with 1000 additions and 189 deletions

View file

@ -21,7 +21,7 @@ class UpdatePackagingItemRequest extends FormRequest
'packaging_material_id' => ['required', 'integer', 'exists:packaging_materials,id'],
'supplier_id' => ['nullable', 'integer', 'exists:suppliers,id'],
'name' => ['required', 'string', 'max:255'],
'category' => ['required', Rule::in(['packaging', 'shipping', 'label', 'shipping_office'])],
'category' => ['required', Rule::in(['packaging', 'shipping'])],
'weight_grams' => ['nullable', 'numeric', 'min:0'],
'min_stock_alert' => ['nullable', 'integer', 'min:0'],
'url' => ['nullable', 'url', 'max:500'],
@ -34,6 +34,8 @@ class UpdatePackagingItemRequest extends FormRequest
{
$this->merge([
'active' => $this->boolean('active'),
'category' => trim((string) $this->input('category')),
'weight_grams' => $this->filled('weight_grams') ? reFormatNumber($this->input('weight_grams')) : null,
]);
foreach (['supplier_id', 'product_id', 'min_stock_alert'] as $key) {