Laravel '无法解析的依赖解析 [参数 #0 [ <required>]

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32819962/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 12:25:04  来源:igfitidea点击:

Laravel 'Unresolvable dependency resolving [Parameter #0 [ <required>"

phpsymfonylaravellaravel-5

提问by Bharanikumar

Error on Laravel

Laravel 上的错误

Getting blank page Laravel version: 5.1.16 Error Logged with below message

获取空白页 Laravel 版本:5.1.16 错误记录以下消息

[2015-09-28 09:37:48] local.CRITICAL: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Uncaught exception 'Illuminate\Contracts\Container\BindingResolutionException' with message 'Unresolvable dependency resolving [Parameter #0 [ $path ]] in class GrahamCampbell\Exceptions\ExceptionInfo' in /bootstrap/cache/compiled.php:1282

[2015-09-28 09:37:48] local.CRITICAL: 异常 'Symfony\Component\Debug\Exception\FatalErrorException' 带有消息 'Uncaught exception 'Illuminate\Contracts\Container\BindingResolutionException' 和消息 '不可解析的依赖项解析 [Parameter #0 [ $path ]] 在类 GrahamCampbell\Exceptions\ExceptionInfo' 中 /bootstrap/cache/compiled.php:1282

What is the root cause ? what is the solution for this problem ?

根本原因是什么?这个问题的解决方案是什么?

回答by Flyingkiwi9

Have a read of what it truly says

阅读它的真实内容

Unresolvable dependency resolving [Parameter #0 [ $path ]] in class

无法解析的依赖解析类中的 [Parameter #0 [ $path ]]

So Laravel can't resolve (create) a dependency that needs to be injected into another.

所以 Laravel 无法解析(创建)需要注入到另一个依赖项中的依赖项。

A giveaway for debugging this problem is that the error occurred in a compiled class, so try running the php artisan clear-compiledcommand.

调试此问题的一个赠品是错误发生在已编译的类中,因此请尝试运行该php artisan clear-compiled命令。