validate([ 'post_id' => ['required', 'uuid'], ]); $post = Post::where('workspace_id', $request->user()->current_workspace_id) ->with(['postPlatforms.socialAccount']) ->find(data_get($validated, 'post_id')); if (! $post) { return Response::error('Post not found.'); } return Response::structured([ 'post_id' => $post->id, 'platforms' => app(PostMetricsFetcher::class)->forPost($post)->all(), ]); } public function schema(JsonSchema $schema): array { return [ 'post_id' => $schema->string()->required()->description('UUID of the published post.'), ]; } }