这是我的forumthread
桌子:
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->foreign( 'user_id' )->references( 'id' )->on( 'users' );
$table->string('thread');
$table->string('slug');
$table->dateTime('published_at');
这是我的forumindex
桌子:
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->foreign( 'user_id' )->references( 'id' )->on( 'users' );
$table->integer('forumthreads_id')->unsigned();
$table->foreign( 'forumthreads_id' )->references( 'id' )->on( 'forumthreads' );
$table->string('slug');
$table->string('title');
$table->text('body');
$table->dateTime('published_at');
在我的forumthread
桌子上有一个hasmany('forumindex');
和在我的forumindex
一个belongsTo('forumthread');
。当我渲染视图时,它说column not found
。
这是视图:
@foreach($thread->forumindex()->orderBy('created_at', 'desc')->paginate(9) as $forumindex)
<p>{{ $forumindex->title }}</p>
@endforeach
我想念的是什么?
我再次在没有s的数据库上创建我的线程及其解决方案
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句