@extends('layouts.user') @section('title', 'Dashboard') @section('page-title', 'Dashboard') @section('page-subtitle', now()->format('l, F j, Y')) @section('content') @php $meals = $todayMeals ?? collect(); $calories = (float) ($todayCalories ?? $meals->sum('calories')); $target = (int) (auth()->user()->calorie_target ?? 2000); $protein = (float) ($proteinTotal ?? $meals->sum('protein')); $carbs = (float) ($carbsTotal ?? $meals->sum('carbs')); $fat = (float) ($fatTotal ?? $meals->sum('fat')); $progress = $target > 0 ? min(100, ($calories / $target) * 100) : 0; $remaining = max(0, $target - $calories); $hour = now()->hour; $greeting = $hour < 12 ? 'Good morning' : ($hour < 18 ? 'Good afternoon' : 'Good evening'); @endphp
Here's your nutrition summary for today.
Track what you've eaten today.
| Meal | Food | Quantity | Calories | Time |
|---|---|---|---|---|
| {{ $meal->meal_type }} | {{ $meal->food_name }} | {{ number_format($meal->quantity_grams) }}g | {{ number_format($meal->calories) }} kcal | @if ($meal->consumed_at) {{ $meal->consumed_at->format('h:i A') }} @else — @endif |
| No meals logged today. Browse foods to add your first meal. | ||||