You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
is_homepage is always false when trailing slashes are enforced #15612
With trailing slashes enforced, Site::url() keeps the trailing slash through URL::tidy(), so absoluteUrl() returns https://example.test/. Laravel's Request::url() always strips the trailing slash and returns https://example.test, so the two never match.
I expected is_homepage to be true on the homepage regardless of the trailing slash setting.
How to reproduce
Add URL::enforceTrailingSlashes(); to AppServiceProvider::boot().
Put {{ is_homepage ? 'home' : 'not home' }} in a template and visit /.
It renders "not home". Without enforceTrailingSlashes() it renders "home".
The comparison is unchanged on the current 6.x branch (v6.35.1). Stripping the trailing slash from the site URL before comparing fixes it; I'll open a PR with that change and tests.
Activity