'datetime:Y-m-d', 'to' => 'datetime:Y-m-d', 'amount' => 'float', ]; /** * Get the User this goal belongs to. */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get options for the "goal" column. * * @return array */ public static function getGoalOptions(): array { $options = []; foreach (Nutrients::$all as $nutrient) { $key = "{$nutrient['value']}_per_day"; $options[$key] = [ 'value' => $key, 'label' => "{$nutrient['value']} per day", 'unit' => $nutrient['unit'], ]; } return $options; } }