Skip to content

Fix dynamic base_url in Laravel docs - #1089

Open
MohannadElemary wants to merge 1 commit into
knuckleswtf:v5from
MohannadElemary:fix/dynamic-base-url-laravel-type
Open

MohannadElemary wants to merge 1 commit into
knuckleswtf:v5from
MohannadElemary:fix/dynamic-base-url-laravel-type

Conversation

@MohannadElemary

Copy link
Copy Markdown

Since 5.10, a dynamic base_url like {{ config("app.url") }} is evaluated during scribe:generate, even for laravel docs. When generating in CI with APP_URL=http://localhost, code samples and Try It Out keep that URL, while the intro uses the serving environment's URL.

This was introduced in #1076. For laravel output, the generated page is already a Blade view, so the expression should be evaluated when the page is served. This change limits generation-time rendering to static output using outputIsStatic(). Static behavior is unchanged.

Verified with Laravel 13 and Scribe 5.11. After the fix, the intro, bash sample and Try It Out all use the serving environment's URL. The full test suite and Pint pass.

If you used @{{ config("app.url") }} as a workaround, change it back to {{ config("app.url") }}.

Fixes #1088.

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.

base_url displays literal value in API docs header when using @{{ config("app.url") }}

1 participant