Scaffold a new PHP REST API endpoint with controller, model, route, and PHPUnit test.
Scaffold a complete PHP API endpoint. Accepts $ARGUMENTS as the resource name and optional HTTP method.
/new-endpoint orders — scaffold full CRUD for orders/new-endpoint orders GET — scaffold GET endpoint only/new-endpoint orders POST — scaffold POST endpoint onlyParse $ARGUMENTS: extract resource name (required) and HTTP method (optional, default: full CRUD)
Create controller at backend/controllers/{ResourceName}Controller.php:
{"data": ..., "error": ..., "meta": ...}Create model at backend/models/{ResourceName}.php:
Add route in backend/api/routes.php:
GET /api/{resource}, POST /api/{resource}, etc.Create PHPUnit test at backend/tests/Feature/Controllers/{ResourceName}ControllerTest.php:
Report created files and suggest next steps (run tests, add business logic)