Skip to content

Bug: Print errors in array validations #3917

@luispastendev

Description

@luispastendev

Hello I am trying to print the errors when I validate an array structure for example:

<select multiple name="categories[]">
# validation rules
 'categories.*' => 'is_not_unique[categories.id]'

# return errors
return redirect()->back()
                ->with('errors', $this->validator->getErrors())

then I try to print the errors in my html but it cannot show them, I suppose it is because of the key format that the function to obtain the errors returns

<?=session('errors.categories.*')?>

I think it is not the most practical way to return errors when it comes to array validations :(

thanks for everything!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions