laravel Illegal offset type error

8 浏览
0 Comments

laravel Illegal offset type error

我有一个页面显示单个测试用例的详细信息。出于某种原因,即使发送了$id,我仍然无法解决这个错误。这是我的控制器:

public function show($id)
{
    $data =DB::table('TestCase')->where('TestCaseID', $id);
    return view('managements.testcase-details')->with($data);
}

这是错误信息:

在View.php的第180行

在HandleExceptions->handleError('2', 'Illegal offset type', 'C:\xampp\htdocs\terkwazmng\vendor\laravel\framework\src\Illuminate\View\View.php', '180', array('key' => object(Builder), 'value' => null))

0