[9.x] Migrate mail components - #44527
Merged
Merged
Conversation
timacdonald
commented
Oct 10, 2022
Comment on lines
-152
to
+153
| return "<?php foreach(\$attributes->onlyProps{$expression} as \$__key => \$__value) { | ||
| return "<?php \$attributes ??= new \\Illuminate\\View\\ComponentAttributeBag; ?> | ||
| <?php foreach(\$attributes->onlyProps{$expression} as \$__key => \$__value) { |
Member
Author
There was a problem hiding this comment.
This ensures that the older style syntax works can show views that use the @props directive. In place for BC.
timacdonald
commented
Oct 10, 2022
Comment on lines
+315
to
+317
| if (Str::startsWith($component, 'mail::') && $viewFactory->exists($component)) { | ||
| return $component; | ||
| } |
Member
Author
There was a problem hiding this comment.
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.
Member
Author
|
Documentation: laravel/docs#8284 |
timacdonald
marked this pull request as ready for review
October 10, 2022 05:47
|
I'm now getting an exception when running |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.