laravel - 找不到我的页面,有人可以帮我吗?
问题描述
这是我在控制器中的功能
public function list()
{
$customers = Customer::all();
foreach ($customers as $customer) {
$list = [
'Customer ID' => $customer->id,
'Customer Name' => $customer->full_name,
];
$lists[] = $list;
}
$collection = $this->paginate($lists, $perPage = 5, $page = null, $options = []);
return new mainCollection($collection);
}
这是我的路线
Route::get('customers/list', 'customerController@list')
当我在 PostMan 中访问http://127.0.0.1:8000/api/customers/list时出现错误 404 Not Found Another Route 运行良好。有人能帮我吗?
解决方案
检查php artisan route:list
/仔细检查您的路线信息。
此外,请检查您的控制器类名称和命名空间。
推荐阅读
- node.js - Nodemailer 发送附件失败
- r - Bookdown 不呈现书籍章节
- wpf - WIX 工具集自定义操作正在执行错误的可执行文件
- node.js - 从 Node 中返回的指针调用 C 函数
- react-native - 将 web api asp.net 项目集成到 React Native App 中
- python - 如何运行我已经下载的模块?
- android - 如何在Android中清除以前打开的活动
- javascript - 如何按数量将产品添加到购物车?- 上下文 API - 反应
- compiler-errors - dart 的 ObjectBox:无法在 iOS 上编译
- node.js - 运行 npm run dev 时出现内部/模块/cjs/loader.js:892 错误