php - Laravel 流明错误:在全栈 laravel 框架中实现流明时出错
问题描述
我在全栈 Laravel 框架中添加了 Laravel 流明,但我遇到了如下 API 路由问题。请帮我解决以下问题。
我添加了 bootstrap/api.php 以在 laravel 框架中使用 lumen。我在 Laravel 框架中配置如下流明。
引导启动/api.php
$app->register(App\Providers\AppServiceProvider::class);
App\Providers\AppServiceProvider
$this->app->singleton('Illuminate\Contracts\Routing\ResponseFactory', function ($app) {
return new ResponseFactory(
$app['Illuminate\Contracts\View\Factory'],
$app['Illuminate\Routing\Redirector']);
});
在中添加上述代码后AppServiceProvider
,我收到此错误:
目标 [Illuminate\Routing\RouteCollectionInterface] 在构建 [Illuminate\Routing\Redirector, Illuminate\Routing\UrlGenerator] 时不可实例化
先感谢您。
解决方案
推荐阅读
- php - 如何将数据从控制器传递到codeigniter3中的自定义钩子
- javascript - 如何在 vis.js 时间线中获取开始和结束时间?
- mysql - MYSQL - 如何使用 group by 获取每个类型字段中的最新记录
- vba - 循环隐藏工作表
- java - 仅当子字符串是整个单词时才替换字符串中的所有子字符串
- r - 如何将 PAD 函数(来自 PADR() 包)用于多个数据帧?
- java - API 测试。如何管理有效负载
- sql-server - 在 SQL Server 中根据时间可用性过滤表记录
- c# - BindingSource.Path 和 BindingSource.Query 之间的区别
- javascript - 我曾尝试添加 gstamount+total 但未添加