@foreach ($dates as $date)
@endforeach
{{ $date->insert_date }}
Date | Location | @foreach ($gifts as $gift){{ $gift->gift }} | @endforeach
---|---|---|
{{ $date->insert_date }} | {{ $city->city }} | @foreach ($data->unique('gift') as $gift) @php $query = $data ->where('insert_date', $date->insert_date) ->where('gift', $gift->gift) ->where('city', $city->city); // ->where([ // 'insert_date' => $date->insert_date, // 'gift' => $gift->gift, // 'city' => $city->city, // ]); // dump($query); $winners = $query->count() > 0 ? $query->first()->winners : 0; @endphp{{ $winners }} | @endforeach