ensureCrmSubscription(); $statuses = $this->tmsUtil->shipmentStatuses(); $shipments = Shipment::where('business_id', $this->businessId()) ->where('contact_id', $this->contactId()) ->with(['driver:id,name', 'vehicle:id,plate_number', 'project:id,name']) ->orderByDesc('created_at') ->paginate(20); return view('portal::customer.shipments.index', compact('shipments', 'statuses')); } public function show($id) { $this->ensureCrmSubscription(); $statuses = $this->tmsUtil->shipmentStatuses(); $shipment = Shipment::where('business_id', $this->businessId()) ->where('contact_id', $this->contactId()) ->with(['driver', 'vehicle', 'project', 'statusLogs']) ->findOrFail($id); return view('portal::customer.shipments.show', compact('shipment', 'statuses')); } }