Make SlugManager available to blade template #3194
Merged
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.
Fixes #0000
I discovered that, it is not possible to use
SlugManager
within a mail template. Example use case: https://github.com/FriendsOfFlarum/subscribed/blob/be01ea2b2259733c5e59b970e8bb6172243982bc/resources/views/emails/userCreated.blade.php#L5This template errors if the user slugger is not
default
.A solution is ready, but requires this PR: FriendsOfFlarum/subscribed#15
Changes proposed in this pull request:
Make
SlugManager
available toblade
templatesReviewers should focus on:
I also considered adding an alias, something like
flarum.slug.manager
here, and resolving from that in the template, but I think the above solution is probably more dev friendlyhttps://github.com/flarum/core/blob/master/src/Http/HttpServiceProvider.php#L64-L66
Screenshot
Necessity
Confirmed
composer test
).Required changes: