1

This is the error I am getting at the moment:

Illuminate\Support\ViewErrorBag {#1725 ▼ // resources/views/components/forms/form.blade.php
  #bags: array:1 [▶
    "default" => Illuminate\Support\MessageBag {#1726 ▶
      #messages: array:5 [▶
        "name" => array:1 [▶
          0 => "The name field is required."
        ]
        "description" => array:1 [▶
          0 => "The description field is required."
        ]
        "meta.0" => array:1 [▶
          0 => "If there is addition description for please make it at least 30 characters long"
        ]
        "meta.1" => array:1 [▶
          0 => "If there is addition description for please make it at least 30 characters long"
        ]
        "meta.2" => array:1 [▶
          0 => "If there is addition description for please make it at least 30 characters long"
        ]
      ]
      #format: ":message"
    }
  ]
}

In the Request class I am trying to do this, but without success:

public function attributes(): array
    {
        return [
            'meta.*' => 'meta'
        ];
    }

Is it possible to merge all the meta.1, meta.2 ... into meta error attribute?

1
  • You can override the failedValidation method in your Form Request and manipulate the errors / messages before the Exception is thrown Commented Apr 27, 2023 at 10:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.