Skip to content

Allow Blade syntax in base_url config#1076

Merged
shalvah merged 1 commit into
knuckleswtf:v5from
chengkangzai:feat/blade-render-base-url
May 9, 2026
Merged

Allow Blade syntax in base_url config#1076
shalvah merged 1 commit into
knuckleswtf:v5from
chengkangzai:feat/blade-render-base-url

Conversation

@chengkangzai

Copy link
Copy Markdown
Contributor

Summary

  • Renders base_url through Blade::render() once inside HtmlWriter::__construct, so values like {{ config('app.url') }} are resolved before reaching any theme view.
  • Works for every HTML theme (and ExternalHtmlWriter via inheritance) — not just elements. Addresses the review feedback left on fix: allow blade syntax in baseUrl config #944.
  • Cheap Str::contains guard skips the Blade compiler for plain URLs, avoiding the need for a fully-booted view factory (e.g., when __components hint paths aren't registered).

Refs #943.

Test plan

  • vendor/bin/pest --filter HtmlWriterTest — added renders blade syntax in base url and leaves plain base url untouched cases
  • vendor/bin/pest — full suite passes (324 tests)

🤖 Generated with Claude Code

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
@shalvah shalvah merged commit d661c3f into knuckleswtf:v5 May 9, 2026
7 checks passed
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.

2 participants