'datetime:Y-m-d', 'to' => 'datetime:Y-m-d', 'goal' => 'float', ]; /** * Get the User this goal belongs to. */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get options for the "attribute" column. * * @return array */ public static function getAttributeOptions(): array { $options = []; foreach (Nutrients::$all as $nutrient) { foreach (['daily', 'weekly', 'monthly', 'yearly'] as $frequency) { $key = "{$nutrient['value']}_{$frequency}"; $options[$key] = [ 'value' => $key, 'label' => Str::ucfirst("{$frequency} {$nutrient['value']}") ]; } } return $options; } }