在我的控制器是緊湊的對象與此代碼PHP laravel緊湊,使用attibute不行
public function getEdit($var = '') {
$words = Word::where('title', $var)->get();
return view('dict.edit', compact('words'));
}
在我看來,我需要使用attibute標題形式的文字,然後我打電話。
<h3>{{ $words->title }}</h3>
它有錯誤問題說未定義的屬性:Illuminate \ Database \ Eloquent \ Collection :: $ title。
確定THXü非常非常有用的 –