Skip to content

Enforce trailing slashes - breaks CP breadcrumb nav and asset container path #14126

@bdroberson

Description

@bdroberson

Bug description

I've enabled trailing slashes within the AppServiceProvider boot method. Doing this breaks the control panels collection breadcrumb navigation paths.

It also breaks the asset container paths, meaning if you have two different asset containers (Assets, PDFs) you can no longer get to the second container.

How to reproduce

Add this to the boot method of your AppServiceProvider:

use Statamic\Facades\URL;

URL::enforceTrailingSlashes();

Logs

Environment

Environment
Application Name: Statamic
Laravel Version: 12.53.0
PHP Version: 8.4.16
Composer Version: 2.9.5
Environment: local
Debug Mode: ENABLED
URL: test-statamic-six.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.4.1 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions