Add Error Handling & API Response Trait
Description
Create consistent error handling and API response formatting.
Acceptance Criteria
-
ApiResponse trait created -
Global exception handler configured -
404 returns JSON for API routes -
Validation errors properly formatted -
Consistent response structure
Implementation Steps
- Create app/Traits/ApiResponse.php
- Update app/Exceptions/Handler.php
- Add renderables for common exceptions
- Test error responses
Reference
- Roadmap:
docs/roadmaps/Implementation_Roadmap_Backend.mdPhase 8, Step 12 - Standards:
backend/CLAUDE.md- Error Handling section
Related Issues
- Depends on: #8 (closed), #9 (closed)