reply = $reply; $this->reply->load(['workOrder']); $this->reply->workOrder->load(['module']); // $this->reply->user = $this->reply->workOrder->user; } /** * Execute the job. * * @return void */ public function handle() { // $http = Http::remote($this->reply->workOrder->module->api_token, $this->reply->workOrder->module->url); $response = $http->post('work-orders/' . $this->reply->workOrder->id . '/replies', $this->reply->toArray()); if ($response->successful()) { $this->reply->is_pending = false; } else { $this->reply->is_pending = true; } $this->reply->save(); } }