Laravel:在null上调用成员函数make()

时间:2019-03-13 14:27:09

标签: php laravel homestead

出于复杂的原因,我试图运行一个我未开发的Laravel项目。我正在使用Vagrant / Homestead组合(Host Windows 10,VM Homestead v2.1.8(Ubuntu 18.04.1)和Laravel 5.0.35,PHP 5.6-这是在其中创建的),然后将项目放在此处并运行composer安装,我只是想看看通过

的路线
php artisan route:list

这给了我错误

PHP Fatal error:  Call to a member function make() on null in /home/vagrant/code/newbackend/vendor/compiled.php on line 4823
PHP Stack trace:
PHP   1. {main}() /home/vagrant/code/newbackend/artisan:0
PHP   2. Illuminate\Foundation\Console\Kernel->handle() /home/vagrant/code/newbackend/artisan:36
PHP   3. Symfony\Component\Console\Application->run() /home/vagrant/code/newbackend/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:94
PHP   4. Symfony\Component\Console\Application->doRun() /home/vagrant/code/newbackend/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP   5. Symfony\Component\Console\Application->doRunCommand() /home/vagrant/code/newbackend/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP   6. Illuminate\Console\Command->run() /home/vagrant/code/newbackend/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP   7. Symfony\Component\Console\Command\Command->run() /home/vagrant/code/newbackend/vendor/laravel/framework/src/Illuminate/Console/Command.php:101
PHP   8. Illuminate\Console\Command->execute() /home/vagrant/code/newbackend/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
PHP   9. Illuminate\Container\Container->call() /home/vagrant/code/newbackend/vendor/laravel/framework/src/Illuminate/Console/Command.php:115
PHP  10. call_user_func_array:{/home/vagrant/code/newbackend/vendor/compiled.php:964}() /home/vagrant/code/newbackend/vendor/compiled.php:964
PHP  11. Illuminate\Foundation\Console\RouteListCommand->fire() /home/vagrant/code/newbackend/vendor/compiled.php:964
PHP  12. Illuminate\Foundation\Console\RouteListCommand->getRoutes() /home/vagrant/code/newbackend/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:75
PHP  13. Illuminate\Foundation\Console\RouteListCommand->getRouteInformation() /home/vagrant/code/newbackend/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:89
PHP  14. Illuminate\Foundation\Console\RouteListCommand->getMiddleware() /home/vagrant/code/newbackend/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:109
PHP  15. Illuminate\Foundation\Console\RouteListCommand->getControllerMiddleware() /home/vagrant/code/newbackend/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:142
PHP  16. Illuminate\Foundation\Application->make() /home/vagrant/code/newbackend/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:161
PHP  17. Illuminate\Container\Container->make() /home/vagrant/code/newbackend/vendor/compiled.php:1543
PHP  18. Illuminate\Container\Container->build() /home/vagrant/code/newbackend/vendor/compiled.php:1019
PHP  19. Illuminate\Container\Container->getDependencies() /home/vagrant/code/newbackend/vendor/compiled.php:1081
PHP  20. Illuminate\Container\Container->resolveClass() /home/vagrant/code/newbackend/vendor/compiled.php:1095
PHP  21. Illuminate\Foundation\Application->make() /home/vagrant/code/newbackend/vendor/compiled.php:1111
PHP  22. Illuminate\Container\Container->make() /home/vagrant/code/newbackend/vendor/compiled.php:1543
PHP  23. Illuminate\Container\Container->fireResolvingCallbacks() /home/vagrant/code/newbackend/vendor/compiled.php:1029
PHP  24. Illuminate\Container\Container->fireCallbackArray() /home/vagrant/code/newbackend/vendor/compiled.php:1180
PHP  25. Illuminate\Validation\ValidationServiceProvider->Illuminate\Validation\{closure}() /home/vagrant/code/newbackend/vendor/compiled.php:1195
PHP  26. Illuminate\Foundation\Http\FormRequest->validate() /home/vagrant/code/newbackend/vendor/compiled.php:4699
PHP  27. Illuminate\Foundation\Http\FormRequest->getValidatorInstance() /home/vagrant/code/newbackend/vendor/compiled.php:4772

错误将我引向

$factory = $this->container->make('Illuminate\\Validation\\Factory');

在class / Request / compiled.php中的第4823行上的FormRequest类中(扩展了Request实现ValidatesWhenResolved的实现)-但这并不能告诉我很多。

由于我是Php / laravel的新手,并且对这个项目的复杂性不太了解,因此我的搜寻工作使我比以往更加困惑。至少有人对我有一个解决此问题的起点吗?

0 个答案:

没有答案