Build a PHP Backend with a Full REST API
Prompt to generate modern PHP backends with a REST API. Includes JWT authentication, validation, pagination, filters, relationships, tests, and OpenAPI documentation.
Create a full, professional PHP 8+ backend with a REST API.
## Specifications
- Name: [NOME_SISTEMA]
- Features: [LISTA_DE_RECURSOS]
- Database: MySQL 8+
- Auth: JWT
## Structure
/src/Controllers, /Models, /Middlewares, /Services, /Validators
## Auth Endpoints
- POST /api/auth/register
- POST /api/auth/login
- POST /api/auth/refresh
- POST /api/auth/logout
- GET /api/auth/me
## CRUD by resource
- GET /api/{resource} — list with pagination and filters
- POST /api/{resource} — create
- GET /api/{resource}/{id} — details
- PUT /api/{resource}/{id} — update
- DELETE /api/{resource}/{id} — remove (soft delete)
## Required patterns
- Response: { data, meta, errors }
- Pagination: { page, per_page, total, last_page }
- Filters via query string
- Rate limiting: 60 req/min
- CORS configured
- Validation in Portuguese
- Global exception handling
- Structured logs
## Database
- Versioned migrations
- Test seeds
- Indexes and foreign keys
## Tests
- Unit and integration with PHPUnit
- Coverage >= 80%
## Docs
- OpenAPI 3.0 (Swagger)
- Postman Collection
Generate all files with working code.