database - 数据库外观返回“传递给 Symfony\Component\HttpFoundation\Response::setContent() 的参数 1 必须是字符串类型或 null,给定对象”
问题描述
我需要从我的 LeadRepository 类中显示一个潜在客户注册。
use Illuminate\Support\Facades\DB;
public function show(Lead $lead)
{
try {
return DB::table('leads')->find($lead->id);
} catch (Exception $exception) {
return $this->exceptionJson($exception);
}
}
但我得到的只是这个错误:
TypeError: Argument 1 passed to Symfony\Component\HttpFoundation\Response::setContent() must be of the type string or null, object given, called in C:\xampp\htdocs\novosimuladornewsun\api\vendor\laravel\framework\src\Illuminate\Http\Response.php on line 72 in file C:\xampp\htdocs\novosimuladornewsun\api\vendor\symfony\http-foundation\Response.php on line 412
解决方案
推荐阅读
- ios - Cordova 自定义 URL 方案插件不起作用
- julia - 如何获取取决于数据框列子集的新列
- django - 在 Django 站点框架中,子域是否被视为“网站”?
- python - python pandas循环融化或旋转多个df
- javascript - React - Jest RTL 检查元素是否不可见
- python - 列表继承方法的不可散列类型错误
- python - 对 PHP 和 Python 使用一致的 ODM
- python - 使用 Python 的 CSV 库没有以所需的速率进行数据记录
- json - 从 node-red-contrib-tasmota JSON 获取 Zigbee 设备信息
- sql - SQL 删除带约束的行