From f6fa2cf79fc09a0d795266522489cfe87ff8a766 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Tue, 20 Apr 2021 18:51:51 -0700 Subject: [PATCH] Allow null value for recipe volume --- app/Http/Controllers/RecipeController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/RecipeController.php b/app/Http/Controllers/RecipeController.php index a0dde29..a95f058 100644 --- a/app/Http/Controllers/RecipeController.php +++ b/app/Http/Controllers/RecipeController.php @@ -201,11 +201,14 @@ class RecipeController extends Controller 'description_delta' => $input['description_delta'], 'servings' => (int) $input['servings'], 'weight' => $input['weight'], - 'volume' => Number::floatFromString($input['volume']), + 'volume' => $input['volume'], 'time_prep' => (int) $input['time_prep'], 'time_cook' => (int) $input['time_cook'], 'source' => $input['source'], ]); + if (!empty($input['volume'])) { + $recipe->volume = Number::floatFromString($input['volume']); + } try { DB::transaction(function () use ($input, $recipe, $request) {