1. Home
  2. {{ str_replace('-', ' ', Request::path()) }}
{{ str_replace('-', ' ', Request::path()) }}
  • Sign Out
  • {{--
  • --}} @php use Carbon\Carbon; $role_id = auth()->user()->role_id; if ($role_id == 1 || $role_id == 4) { $notifications = DB::table('shipments') ->select('order_id', 'tracking_number', 'status', 'created_at', 'updated_at') ->where(function ($query) { $query->where('created_at', '>=', Carbon::now()->subDay()) ->orWhere('updated_at', '>=', Carbon::now()->subDay()); }) ->orderBy('updated_at', 'desc') ->take(5) ->get(); } elseif ($role_id == 2) { $user_id = auth()->user()->id; $notifications = DB::table('shipments') ->select('order_id', 'tracking_number', 'status', 'created_at', 'updated_at') ->where('customers', $user_id) ->where(function ($query) { $query->where('created_at', '>=', Carbon::now()->subDay()) ->orWhere('updated_at', '>=', Carbon::now()->subDay()); }) ->orderBy('updated_at', 'desc') ->take(5) ->get(); } elseif ($role_id == 3) { $vendor_id = auth()->user()->id; $notifications = DB::table('shipments') ->select('order_id', 'tracking_number', 'status', 'created_at', 'updated_at') ->where('vendors', $vendor_id) ->where(function ($query) { $query->where('created_at', '>=', Carbon::now()->subDay()) ->orWhere('updated_at', '>=', Carbon::now()->subDay()); }) ->orderBy('updated_at', 'desc') ->take(5) ->get(); } else { $notifications = collect(); } @endphp
    • @foreach ($notifications as $notification)
    • New order Placed #{{ $notification->order_id }}
      && Tracking No: #{{ $notification->tracking_number }}
      Status: {{ $notification->status }}

      {{ \Carbon\Carbon::parse($notification->created_at)->diffForHumans() }}

      @if($notification->created_at != $notification->updated_at)

      Updated: {{ \Carbon\Carbon::parse($notification->updated_at)->diffForHumans() }}

      @endif
    • @endforeach