【发布时间】:2019-03-21 05:03:59
【问题描述】:
我正在尝试从数据库中读取数据并将数据显示到表单中,但我不断收到此错误。
这是我的控制器:
public function create()
{
/* this function gets data from the database (marks table) and render it to the view view */
$data['data']=DB::table('marks')->get();
if(count($data[0])>0){
return view('view',$data);
}
else{
return view('view');
}
}
这就是我定义路线的方式:
Route::resource('claude', 'viewcontroller');
【问题讨论】:
-
您遇到的错误是什么?
标签: database laravel undefined offset