@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

{{ $greeting }}, {{ auth()->user()->name }}! 👋

Here's your nutrition summary for today.

+ Add Food
Today's Calories
🔥
{{ number_format($calories) }} / {{ number_format($target) }} kcal
💪
Protein

{{ number_format($protein, 1) }}g

Today's intake
🌾
Carbohydrates

{{ number_format($carbs, 1) }}g

Today's intake
🥑
Fat

{{ number_format($fat, 1) }}g

Today's intake

Today's Meals

Track what you've eaten today.

+ Add Food
@forelse ($meals as $meal) @empty @endforelse
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.
@endsection