Questions tagged «laravel-eloquent»

6
该集合实例上不存在属性[title]
我正在关注Laracasts的视频:基本模型/控制器/视图工作流。 我的桌子上有联系方式。 CREATE TABLE `about` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(500) COLLATE utf8_unicode_ci NOT NULL, `content` text COLLATE utf8_unicode_ci, ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci 我正在尝试使用控制器文件中的以下代码传递数据以进行查看: public function index() { $about = Page::where('page', 'about-me')->get(); //id = 3 return view('about', compact('about')); } 当我尝试显示如下所示的代码时, @section('title') {{$about->title}} @stop @section('content') {!! $about->content !!} …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.