Skip to content

[12.x] Validate dynamic component, slot, and attribute names - #62454

Merged
taylorotwell merged 1 commit into
12.xfrom
12.x-validate-dynamic-component-names
Nov 14, 2026
Merged

taylorotwell merged 1 commit into
12.xfrom
12.x-validate-dynamic-component-names

Conversation

@pushpak1300

Copy link
Copy Markdown
Member

DynamicComponent builds a Blade template at runtime from its component name, slot names, and attribute names. A name with characters that the component tag syntax does not accept (quotes, braces, <?) produces a broken template, and the compile error that follows is hard to trace back to the name.

This change checks each name before it goes into the template. It throws an InvalidArgumentException that names the bad value. Valid names such as alert, nav.item, mail::message, and package::foo.bar render as before.

Note

A component, slot, or attribute name outside the accepted characters now throws an InvalidArgumentException when the dynamic component renders.

@pushpak1300
pushpak1300 marked this pull request as ready for review November 12, 2026 18:13
@taylorotwell

Copy link
Copy Markdown
Member

Conflicts on this one.

@taylorotwell
taylorotwell marked this pull request as draft November 13, 2026 15:41
Co-authored-by: Pushpak Chhajed <pushpak@laravel.com>
@pushpak1300
pushpak1300 force-pushed the 12.x-validate-dynamic-component-names branch from 38bad4a to 9556ae8 Compare November 13, 2026 18:01
@pushpak1300
pushpak1300 marked this pull request as ready for review November 13, 2026 18:04
@taylorotwell
taylorotwell merged commit fbd5923 into 12.x Nov 14, 2026
71 checks passed
@taylorotwell
taylorotwell deleted the 12.x-validate-dynamic-component-names branch November 14, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants