-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[9.x] Migrate mail components #44527
[9.x] Migrate mail components #44527
Conversation
return "<?php foreach(\$attributes->onlyProps{$expression} as \$__key => \$__value) { | ||
return "<?php \$attributes ??= new \\Illuminate\\View\\ComponentAttributeBag; ?> | ||
<?php foreach(\$attributes->onlyProps{$expression} as \$__key => \$__value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures that the older style syntax works can show views that use the @props
directive. In place for BC.
if (Str::startsWith($component, 'mail::') && $viewFactory->exists($component)) { | ||
return $component; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've given special treatment to mail::
prefixed components, as they are given special treatment in the framework.
This is explicitly performed after the loop to ensure it does not change current functionality in anyway.
Documentation: laravel/docs#8284 |
I'm now getting an exception when running
|
This PR allows mail components to be used with the
<x-component>
syntax.These two are now identical:
Below are some of the test views I've used to ensure things are working as expected. You may like to fire these up in a standalone Mailable to test out.