Error column not found in Laravel

我是研究僧i 提交于 2019-12-10 19:31:18

问题


This is my forumthread table:

        $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');

And this is my forumindex table:

        $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');

In my forumthread table I have a hasmany('forumindex'); and in my forumindex a belongsTo('forumthread');. When I render the view it says column not found.

Here's the view:

@foreach($thread->forumindex()->orderBy('created_at', 'desc')->paginate(9) as $forumindex)
    <p>{{ $forumindex->title }}</p>
@endforeach

What is it that I am missing?


回答1:


i create again my thread on database without s and its solve



来源:https://stackoverflow.com/questions/36642130/error-column-not-found-in-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!