Allow Blade syntax in base_url config#1076
Merged
Merged
Conversation
Renders the configured `base_url` through `Blade::render()` once inside
`HtmlWriter::__construct`, so values like `{{ config('app.url') }}` are
resolved before they reach any theme view. Addresses the review feedback
on knuckleswtf#944 — works for every HTML theme (and ExternalHtmlWriter via
inheritance), not just `elements`.
A cheap `Str::contains` guard skips the Blade compiler for plain URLs,
which avoids needing a fully-booted view factory in environments where
`__components` hint paths aren't registered.
Refs knuckleswtf#943
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.
Summary
base_urlthroughBlade::render()once insideHtmlWriter::__construct, so values like{{ config('app.url') }}are resolved before reaching any theme view.ExternalHtmlWritervia inheritance) — not justelements. Addresses the review feedback left on fix: allow blade syntax in baseUrl config #944.Str::containsguard skips the Blade compiler for plain URLs, avoiding the need for a fully-booted view factory (e.g., when__componentshint paths aren't registered).Refs #943.
Test plan
vendor/bin/pest --filter HtmlWriterTest— addedrenders blade syntax in base urlandleaves plain base url untouchedcasesvendor/bin/pest— full suite passes (324 tests)🤖 Generated with Claude Code