在Laravel中找不到错误列 [英] Error column not found in Laravel

查看:76
本文介绍了在Laravel中找不到错误列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的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.

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.

这是视图:

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

我想念什么?

推荐答案

我在没有s的数据库上再次创建我的线程及其解决方法

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

这篇关于在Laravel中找不到错误列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆