Php 在laravel进行回购时出错

Php 在laravel进行回购时出错,php,laravel,Php,Laravel,照亮\Contracts\Container\BindingResolutionException目标 [App\Repositories\FaultTypes\FaultTypesInterface]不可实例化 在生成[App\Http\Controllers\FaultTypesController]时, 应用程序\服务\故障类型服务] 您的控制器中可能有类似的东西 public function __construct(FaultTypesInterface $faultTypes) {

照亮\Contracts\Container\BindingResolutionException目标 [App\Repositories\FaultTypes\FaultTypesInterface]不可实例化 在生成[App\Http\Controllers\FaultTypesController]时, 应用程序\服务\故障类型服务]


您的控制器中可能有类似的东西

public function __construct(FaultTypesInterface $faultTypes) {
...
}

问题是Laravel的服务容器不知道如何实例化这样的接口

您可以通过声明此绑定来解决此问题。因此,在
app/providers/AppServiceProvider.php中
register()
方法中,您可以编写如下内容

app()->bind('App\Repositories\FaultTypes\FaultTypesInterface', 'Path\To\Your\Concrete\Class');

请在我创建存储库并使用时帮助我,然后告诉我错误。并且是[“目标[App\Repositories\FaultTypes\FaultTypesInterface]在生成[App\Http\Controllers\FaultTypesController,App\Services\FaultTypesS]时不可实例化。”▶"]你能把你的代码添加到问题中吗?你能解释一下你到底想做什么吗?你想实现什么吗?同样的问题也在重复。我很抱歉,但是根据你提供的信息,这是我能提供的最好的帮助。