onQueue('tracking'); } public function handle(): void { try { TrackingContentSelection::create([ 'device_id' => $this->deviceId, 'content_type' => $this->contentType, 'content_id' => $this->contentId, 'content_name' => $this->contentName, 'selection_method' => $this->selectionMethod, 'search_query' => $this->searchQuery, 'action_at' => $this->actionAt, 'user_agent' => $this->userAgent, 'ip_address' => $this->ipAddress, 'platform' => $this->platform, ]); } catch (\Exception $e) { Log::error('Failed to track content selection', [ 'device_id' => $this->deviceId, 'content_type' => $this->contentType, 'content_id' => $this->contentId, 'error' => $e->getMessage(), ]); throw $e; } } public function failed(\Throwable $exception): void { Log::error('TrackContentSelectionJob failed permanently', [ 'device_id' => $this->deviceId, 'content_type' => $this->contentType, 'content_id' => $this->contentId, 'exception' => $exception->getMessage(), ]); } }