@extends('master') @section('title') Company @endsection @section('content')
@if (Session::has('success'))
@elseif (Session::has('danger'))
@endif
{{-- --}} @foreach ($company as $item) @php $bookings = $item->id ? App\Models\Booking::where('company_id', $item->id)->get() : collect([]); $total_bill = $bookings->sum('price') ?? 0; $total_shipments = $bookings->count() ?? 0; $payment = $item->name ? App\Models\Payment::where('company_name', $item->name)->sum('payment_amount') : 0; @endphp {{-- --}} @endforeach
Name Phone Email Address Country Currency Logo Total Bill Total Paymentstotal DueAction
{{ $item->name }} {{ $item->phone }} {{ $item->email }} {{ $item->address }} {{ $item->countries->name ?? '' }} {{ $item->currency->symbol ?? '' }} {{ $total_bill }} {{$payment}}total Due
@endsection