Laravel: add a safe database migration
New column/table with indexes, rollback and model updates.
Agent task · Cursor / coding agents, Claude Code, ChatGPT +1
Library / Coding & Technology / API
Endpoint with schema validation, errors and tests.
Add [METHOD /path] to the [Express/Fastify/NestJS/Hono] API that [does X].
- Validate body/query/params with a schema (zod or the framework's validator).
- Keep the handler thin; put logic in a service function.
- Return consistent JSON errors: { error: { code, message } } with correct status codes.
- Check authentication/authorisation.
- Write tests for success, validation failure, and unauthorised access.
Run the tests and the type checker.Copies your prompt and opens the official site in a new tab. You may need to paste it yourself (Ctrl/⌘ + V). Nothing is sent to the AI by us.
Replace [bracketed] parts with your own details before sending. Want it tailored? Build a custom website & app development prompt.
A typical one-line request compared with this prompt. We only show sample responses where we've written an illustration.
Prompt
api
1 words · no role, context, format or constraints
Prompt
Add [METHOD /path] to the [Express/Fastify/NestJS/Hono] API that [does X].
- Validate body/query/params with a schema (zod or the framework's validator).
- Keep the handler thin; put logic in a service function.
- Return consistent JSON errors: { error: { code, message } } with correct status codes.
- Check authentication/authorisation.
- Write tests for success, validation failure, and unauthorised access.
Run the tests and the type checker.68 words · generated instantly from templates, no AI called
What we added
New column/table with indexes, rollback and model updates.
Agent task · Cursor / coding agents, Claude Code, ChatGPT +1
Eager loading fixes with proof.
Agent task · Cursor / coding agents, Claude Code, ChatGPT +1
Thin controllers with proper authorisation.
Agent task · Cursor / coding agents, Claude Code, ChatGPT +1