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(app(PostPreviewer::class)->forPost($post)); } public function schema(JsonSchema $schema): array { return [ 'post_id' => $schema->string()->required()->description('UUID of the post to preview.'), ]; } }