diff --git a/app/Http/Controllers/GoalController.php b/app/Http/Controllers/GoalController.php
index 89ead43..ad0b02e 100644
--- a/app/Http/Controllers/GoalController.php
+++ b/app/Http/Controllers/GoalController.php
@@ -50,7 +50,10 @@ class GoalController extends Controller
*/
public function show(Goal $goal): View
{
- return view('goals.show')->with('goal', $goal);
+ return view('goals.show')
+ ->with('goal', $goal)
+ ->with('nameOptions', Goal::getNameOptions())
+ ->with('frequencyOptions', Goal::$frequencyOptions);
}
/**
diff --git a/app/Models/Goal.php b/app/Models/Goal.php
index 1bd39d5..691e6b7 100644
--- a/app/Models/Goal.php
+++ b/app/Models/Goal.php
@@ -43,7 +43,7 @@ final class Goal extends Model
* Supported options for thr frequency attribute.
*/
public static array $frequencyOptions = [
- ['value' => 'daily', 'label' => 'daily'],
+ 'daily' => ['value' => 'daily', 'label' => 'daily'],
];
/**
diff --git a/app/Support/Nutrients.php b/app/Support/Nutrients.php
index fc5fa88..8d4ecda 100644
--- a/app/Support/Nutrients.php
+++ b/app/Support/Nutrients.php
@@ -10,21 +10,21 @@ class Nutrients
public static float $gramsPerOunce = 28.349523125;
public static array $all = [
- ['value' => 'calories', 'label' => 'calories', 'unit' => null],
- ['value' => 'carbohydrates', 'label' => 'carbohydrates', 'unit' => 'g'],
- ['value' => 'cholesterol', 'label' => 'cholesterol', 'unit' => 'mg'],
- ['value' => 'fat', 'label' => 'fat', 'unit' => 'g'],
- ['value' => 'protein', 'label' => 'protein', 'unit' => 'g'],
- ['value' => 'sodium', 'label' => 'sodium', 'unit' => 'mg'],
+ 'calories' => ['value' => 'calories', 'label' => 'calories', 'unit' => null],
+ 'carbohydrates' => ['value' => 'carbohydrates', 'label' => 'carbohydrates', 'unit' => 'g'],
+ 'cholesterol' => ['value' => 'cholesterol', 'label' => 'cholesterol', 'unit' => 'mg'],
+ 'fat' => ['value' => 'fat', 'label' => 'fat', 'unit' => 'g'],
+ 'protein' => ['value' => 'protein', 'label' => 'protein', 'unit' => 'g'],
+ 'sodium' => ['value' => 'sodium', 'label' => 'sodium', 'unit' => 'mg'],
];
public static array $units = [
- ['value' => 'cup', 'label' => 'cup'],
- ['value' => 'gram', 'label' => 'grams'],
- ['value' => 'oz', 'label' => 'oz'],
- ['value' => 'serving', 'label' => 'servings'],
- ['value' => 'tbsp', 'label' => 'tbsp.'],
- ['value' => 'tsp', 'label' => 'tsp.'],
+ 'cup' => ['value' => 'cup', 'label' => 'cup'],
+ 'gram' => ['value' => 'gram', 'label' => 'grams'],
+ 'oz' => ['value' => 'oz', 'label' => 'oz'],
+ 'serving' => ['value' => 'serving', 'label' => 'servings'],
+ 'tbsp' => ['value' => 'tbsp', 'label' => 'tbsp.'],
+ 'tsp' => ['value' => 'tsp', 'label' => 'tsp.'],
];
/**
diff --git a/resources/views/goals/edit.blade.php b/resources/views/goals/edit.blade.php
index 82fb2bd..94e374b 100644
--- a/resources/views/goals/edit.blade.php
+++ b/resources/views/goals/edit.blade.php
@@ -20,7 +20,7 @@