serviceOrder = $serviceOrder->load([ 'customer', 'vehicle', 'assignedTechnician', 'serviceItems', 'parts', 'inspections', 'appointments' ]); } public function updateStatus($status) { $this->serviceOrder->status = $status; if ($status === 'in_progress' && !$this->serviceOrder->started_at) { $this->serviceOrder->started_at = now(); } elseif ($status === 'completed' && !$this->serviceOrder->completed_at) { $this->serviceOrder->completed_at = now(); } $this->serviceOrder->save(); session()->flash('success', 'Service order status updated successfully!'); // Refresh the model $this->mount($this->serviceOrder); } public function render() { return view('livewire.service-orders.show'); } }