Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method Illuminate\Routing\UrlGenerator::useOrigin does not exist #955

Closed
1 task done
bowles123 opened this issue Feb 22, 2025 · 3 comments
Closed
1 task done

Method Illuminate\Routing\UrlGenerator::useOrigin does not exist #955

bowles123 opened this issue Feb 22, 2025 · 3 comments

Comments

@bowles123
Copy link

Scribe version

5.0.1

Your question

I installed this package and successfully added the scribe config file. However, when I try to generate I'm running into an error as shown in the title. Here's the whole error chain ``` 1 vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:358
Illuminate\Routing\UrlGenerator::__call("useOrigin")

2 vendor/knuckleswtf/scribe/src/Commands/GenerateDocumentation.php:127
Illuminate\Support\Facades\Facade::__callStatic("useOrigin")

3 vendor/knuckleswtf/scribe/src/Commands/GenerateDocumentation.php:45
Knuckles\Scribe\Commands\GenerateDocumentation::bootstrap()

4 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
Knuckles\Scribe\Commands\GenerateDocumentation::handle(Object(Knuckles\Scribe\Matching\RouteMatcher), Object(Knuckles\Scribe\GroupedEndpoints\GroupedEndpointsFactory))

5 vendor/laravel/framework/src/Illuminate/Container/Util.php:43
Illuminate\Container\BoundMethod::Illuminate\Container{closure}()

6 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:95
Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

7 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:35
Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

8 vendor/laravel/framework/src/Illuminate/Container/Container.php:690
Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

9 vendor/laravel/framework/src/Illuminate/Console/Command.php:213
Illuminate\Container\Container::call()

10 vendor/symfony/console/Command/Command.php:279
Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

11 vendor/laravel/framework/src/Illuminate/Console/Command.php:182
Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

12 vendor/symfony/console/Application.php:1047
Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

13 vendor/symfony/console/Application.php:316
Symfony\Component\Console\Application::doRunCommand(Object(Knuckles\Scribe\Commands\GenerateDocumentation), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

14 vendor/symfony/console/Application.php:167
Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

15 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:197
Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

16 artisan:35
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))```.

I can't figure out what I'm doing wrong if anything. All I changed in the scribe file is the type to use static and the routes path. Weird thing is that when I run a compare on the config using scribe:config:diff I only see the change for type.

Docs

@shalvah
Copy link
Contributor

shalvah commented Feb 23, 2025

You're not doing anything wrong. I probably missed something in this conditional.

if (version_compare(Application::VERSION, '11.0', '>=')) {
// Renamed in Laravel 11
URL::useOrigin($baseUrl);
} else {
/* @phpstan-ignore-next-line */
URL::forceRootUrl($baseUrl);

What Laravel version?

@bowles123
Copy link
Author

PHP 8.3.12 and Laravel Framework 11.27.2. On LTS for the package as it was a brand new download

@shalvah
Copy link
Contributor

shalvah commented Feb 25, 2025

Fixed in 5.1.0

@shalvah shalvah closed this as completed Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants