find($this->postId); if (! $post) { return; } $publisher = $publishers->resolve($post); if (! $publisher) { $post->update(['status' => 'draft', 'publish_error' => "No publisher available for post type '{$post->type}'."]); return; } $result = $publisher->publish($post); if ($result->success) { $post->update(['status' => 'published', 'published_url' => $result->url, 'publish_error' => null]); return; } $post->update([ 'status' => $result->attempted ? 'failed' : 'draft', 'publish_error' => $result->error, ]); Log::error('post publish failed', ['post_id' => $post->id, 'error' => $result->error]); } }