From 0d7f1f0f178b48900e09d5d160a07b8d1096244e Mon Sep 17 00:00:00 2001 From: Jack Sleight Date: Fri, 15 Nov 2024 14:10:31 +0000 Subject: [PATCH] Fix bard text triming when CP is on root URL --- src/Providers/AppServiceProvider.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Providers/AppServiceProvider.php b/src/Providers/AppServiceProvider.php index bf2fe3cbb1..ada744379f 100644 --- a/src/Providers/AppServiceProvider.php +++ b/src/Providers/AppServiceProvider.php @@ -96,7 +96,11 @@ public function boot() return optional($this->statamicToken())->handler() === LivePreview::class; }); - TrimStrings::skipWhen(fn (Request $request) => $request->is(config('statamic.cp.route').'/*')); + TrimStrings::skipWhen(function (Request $request) { + $route = config('statamic.cp.route'); + + return ! $route || $request->is($route.'/*'); + }); $this->addAboutCommandInfo();