Explorar el Código

Fix URL::useOrigin/forceRootURL

Shalvah hace 2 meses
padre
commit
956e9bf418
Se han modificado 1 ficheros con 3 adiciones y 4 borrados
  1. 3 4
      src/Commands/GenerateDocumentation.php

+ 3 - 4
src/Commands/GenerateDocumentation.php

@@ -122,11 +122,10 @@ class GenerateDocumentation extends Command
         $baseUrl = $this->docConfig->get('base_url') ?? config('app.url');
 
         /* @phpstan-ignore-next-line */
-        if (version_compare(Application::VERSION, '11.0', '>=')) {
-            // Renamed in Laravel 11
+        try {
+            // Renamed from forceRootUrl in Laravel 11.43 or so
             URL::useOrigin($baseUrl);
-        } else {
-            /* @phpstan-ignore-next-line */
+        } catch (\BadMethodCallException) {
             URL::forceRootUrl($baseUrl);
         }