@extends('layouts.app') @section('title', 'Lista della spesa · FranCoach') @section('content')

Lista della spesa

@if(!$list)@else @php $whatsappText = ''; foreach ($list->items->where('is_checked', false) as $item) { $whatsappText .= $item->item_name; if ($item->total_quantity) { $whatsappText .= ' ('.rtrim(rtrim(number_format((float) $item->total_quantity, 2, ',', '.'), '0'), ',').' '.($item->unit?->label() ?? '').')'; } $whatsappText .= "\n"; } $whatsappUrl = 'https://wa.me/?text='.rawurlencode(trim($whatsappText)); @endphp

Condividi la lista

Apre WhatsApp con il testo della lista già pronto: scegli tu il contatto o il gruppo a cui inviarlo.

Invia su WhatsApp

{{ $list->title }}

{{ $list->start_date->format('d/m/Y') }} – {{ $list->end_date->format('d/m/Y') }}

@foreach($list->items->when($category, fn($items)=>$items->where('category',$category))->groupBy('category') as $group=>$items) @if(mb_strtoupper($group) !== 'OTHER')

{{ $group }}

@endif @foreach($items as $item) @endforeach @endforeach
@endif @endsection