From b322a7074f3ea7a58e09137ef37bf9ea21fcd6e4 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sat, 9 May 2026 13:58:09 -0300 Subject: [PATCH] refactor(posts): drop hardcoded English validation messages Removes the messages() override on UpdatePostRequest. The 4 messages it defined were hardcoded English strings that bypassed Laravel's built-in validation translations. With the override gone, errors flow through lang/{locale}/validation.php which is already translated for en/pt-BR/es. Trade-off: default messages reference the field path (e.g. 'platforms.0.content_type'). Acceptable here because the editor renders errors inline next to each field rather than as a flat list. --- app/Http/Requests/App/Post/UpdatePostRequest.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/Http/Requests/App/Post/UpdatePostRequest.php b/app/Http/Requests/App/Post/UpdatePostRequest.php index d5d98119..d0de7640 100644 --- a/app/Http/Requests/App/Post/UpdatePostRequest.php +++ b/app/Http/Requests/App/Post/UpdatePostRequest.php @@ -72,16 +72,6 @@ public function rules(): array ]; } - public function messages(): array - { - return [ - 'status.required' => 'The post status is required.', - 'status.in' => 'Invalid post status.', - 'platforms.*.content_type.in' => 'Invalid content type.', - 'scheduled_at.after' => 'The scheduled date must be in the future.', - ]; - } - public function withValidator(Validator $validator): void { $validator->after(function ($validator): void {