【发布时间】:2021-05-21 17:07:16
【问题描述】:
我的路线是:
Route::get('/dash/{$slug}', 'DashController@client');
我目前在控制器中使用以下内容:
public function client($slug)
{
$idz = Company::where('CompanyID', $slug)->first();
return view('dashboards.companydashboard', [
'id' => $idz
]);
}
在我的 html 页面中,我有:
<p>{{$id}}</p>
它没有输出值,我错过了什么
【问题讨论】:
-
返回前在控制器中 -> dd($idz);
-
它现在显示一个包含数组的对象(删除了每个旁边列出的详细信息)#table:+primaryKey:+timestamps:#connection:#keyType:+incrementing:#with: #withCount: #perPage: +exists: true +wasRecentlyCreated: etc...