Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Artisan stops working after install #18

Closed
afsardo opened this issue Oct 31, 2016 · 2 comments
Closed

Artisan stops working after install #18

afsardo opened this issue Oct 31, 2016 · 2 comments

Comments

@afsardo
Copy link

afsardo commented Oct 31, 2016

After installing voyager.

php artisan voyager:install

If you try to run any command (php artisan make:model TwitchStream) it throws an error:

PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php on line 60 in /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:103
Stack trace:
#0 /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php(60): Illuminate\Routing\UrlGenerator->__construct(Object(Illuminate\Routing\RouteCollection), NULL)
#1 /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Container/Container.php(290): Illuminate\Routing\RoutingServiceProvider->Illuminate\Routing\{closure}(Object(Illuminate\Foundation\Application))
#2 /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Container/Container.php(746): Illuminate\Container\Container->Illuminate\Container\{closure}(Ob in /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php on line 103

Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php on line 60 in /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:103
Stack trace:
#0 /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php(60): Illuminate\Routing\UrlGenerator->__construct(Object(Illuminate\Routing\RouteCollection), NULL)
#1 /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Container/Container.php(290): Illuminate\Routing\RoutingServiceProvider->Illuminate\Routing\{closure}(Object(Illuminate\Foundation\Application))
#2 /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Container/Container.php(746): Illuminate\Container\Container->Illuminate\Container\{closure}(Ob in /home/vagrant/Code/Voyager/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php on line 103

Because the voyager config file gets published, it is used every time the app is bootstrapped, so it tries to run the asset() function in the config file which excepts a Request object as the second argument and it crashes.

The solution is simply remove the asset() function from the line:
'assets_path' => asset('/vendor/tcg/voyager/assets'),
To:
'assets_path' => '/vendor/tcg/voyager/assets',

And actually everything works because there is no need to use the function.

I will send a pull request.

This was referenced Oct 31, 2016
@tnylea
Copy link
Collaborator

tnylea commented Oct 31, 2016

Thanks man. Just merged it an put it in the latest version.

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants