Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[12.x] Allow sub-array notation in arrays validation#57675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
fgaroby wants to merge1 commit intolaravel:12.x
base:12.x
Choose a base branch
Loading
fromfgaroby:feat/sub-arrays_rules_in_form_request

Conversation

@fgaroby
Copy link
Contributor

@fgarobyfgaroby commentedNov 5, 2025
edited
Loading

This PR allows to use the sub-array notation, in addition to the dot notation.
For example, instead of this:

class NestedArrayRequestextends FormRequest{publicfunctionrules()    {return ['nested.*.bar' =>'required','nested.*.baz' =>'required'        ];    }}

We can now do this:

class SubArrayRequestextends FormRequest{publicfunctionrules()    {return ['nested' => ['*' => ['bar' =>'required','baz' =>'required',                ],            ],        ];    }}

Usefull when the sub-array has many sub-fields.

Of course, the nested notation still works.

If this PR is OK,I also created a PR to improve the Laravel documentation.

shaedrich reacted with rocket emoji
@fgarobyfgaroby changed the titlefeat: allow sub-array notation in arrays validation[12.x] Allow sub-array notation in arrays validationNov 5, 2025
@fgarobyfgaroby changed the title[12.x] Allow sub-array notation in arrays validationDraft: [12.x] Allow sub-array notation in arrays validationNov 5, 2025
@fgarobyfgaroby changed the titleDraft: [12.x] Allow sub-array notation in arrays validation[12.x] Allow sub-array notation in arrays validationNov 5, 2025
@fgarobyfgaroby marked this pull request as draftNovember 5, 2025 10:25
@shaedrich
Copy link
Contributor

I already attempted something similar a while ago in#55491, so don't get your hopes up. That being said, it'd be nice to have this in Laravel, so 🤞🏻

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@fgaroby@shaedrich

[8]ページ先頭

©2009-2025 Movatter.jp