coolify/app/Http/Controllers
Andras Bacsai fa8393184f refactor: improve validation error handling and coding standards
Changes:
1. Add explicit try-catch blocks around validateDockerComposeForInjection()
   in API endpoints to return proper 422 JSON responses with validation errors
2. Rename $service_payload to $servicePayload for PSR-12 compliance (camelCase)

API endpoints now properly handle validation failures:
- One-click service creation (line 334)
- Custom compose service creation (line 480)
- Service update endpoint (line 808)

All return consistent error format:
{
  "message": "Validation failed.",
  "errors": {
    "docker_compose_raw": "Invalid Docker Compose service name: ..."
  }
}

Livewire components already have proper exception handling via handleError().

All 60 security tests pass (176 assertions).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 09:51:37 +02:00
..
Api refactor: improve validation error handling and coding standards 2025-10-16 09:51:37 +02:00
Webhook refactor(webhook): remove Webhook model and related logic; add migrations to drop webhooks and kubernetes tables 2025-09-10 19:35:53 +02:00
Controller.php v4.0.0-beta.420 (#6008) 2025-06-26 12:23:08 +02:00
MagicController.php Fix styling 2024-06-10 20:43:34 +00:00
OauthController.php Remove all ray() calls 2024-10-28 13:51:23 +01:00
UploadController.php Delete some useless imports 2024-10-31 16:33:49 +01:00