Skip to content

Commit 956e9bf

Browse files
committed
Fix URL::useOrigin/forceRootURL
1 parent f96342b commit 956e9bf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Commands/GenerateDocumentation.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,10 @@ public function bootstrap(): void
122122
$baseUrl = $this->docConfig->get('base_url') ?? config('app.url');
123123

124124
/* @phpstan-ignore-next-line */
125-
if (version_compare(Application::VERSION, '11.0', '>=')) {
126-
// Renamed in Laravel 11
125+
try {
126+
// Renamed from forceRootUrl in Laravel 11.43 or so
127127
URL::useOrigin($baseUrl);
128-
} else {
129-
/* @phpstan-ignore-next-line */
128+
} catch (\BadMethodCallException) {
130129
URL::forceRootUrl($baseUrl);
131130
}
132131

0 commit comments

Comments
 (0)