Laravel - SQLSTATE[42S22]:找不到列:1054 字段列表中的未知列


Laravel - SQLSTATE[42S22]: Column not found: 1054 Unknown column in field list

>我需要使用 Laravel
将一个简单的表单数据添加到数据库中每次发布表单时,数据都会进入数据库,但我收到此错误

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tf.FirstName' in 'field list' (SQL: insert into `tbl_fundraising_pages` (`Permalink`, `Name`, `Summary`, `Story`, `Goal_Amount`, `End_Date`, `Designation`, `WebAddress`, `Block_SearchEngine`, `CharityID`, `updated_at`, `created_at`) values (Something-Like-That, Something Like That, Something Like That, <p>Something Like That</p> , 500, 11/04/2014, General Fund, Something-Like-That, NewDesig, 1387, 2014-11-21 15:14:19, 2014-11-21 15:14:19)

没有 TF。在数据库中归档的 FirstName 既没有查询模 态

<?php
class Fundraising extends Eloquent{
    protected $table = 'tbl_fundraising_pages';
    protected $fillable = [
        'fundraiser_id',
        'Permalink',
        'Name',
        'Summary',
        'Story',
        'Goal_Amount',
        'End_Date',
        'Designation',
        'WebAddress',
        'Block_SearchEngine',
        'CharityID'
        ];
}

控制器功能

public function postCreatePage(){
        $charities = Charities::where('Charity_Name','=',''.Input::get('NonprofitName').'')->first();
        $data = array(
          'Permalink' => str_replace(' ', '-', Input::get('FundraiserName')),
          'Name' => Input::get('FundraiserName'),  
          'Summary' => Input::get('Summary'),  
          'Story' => Input::get('YourPassion'), 
          'Goal_Amount' => Input::get('GoalAmount'),
          'Designation' => Input::get('Designation'),
          'WebAddress' => str_replace(' ', '-', Input::get('FundraiserName')),
          'Block_SearchEngine' => Input::get('NewDesig')
        );
        if(Input::get('NonprofitName')){
            $data['CharityID'] = $charities->ID;
        }
        $page = new Fundraising();
        foreach ($data as $key => $insert){
            $page->$key = $insert;
        }
        if($page->save()){
            return Response::json(array('message' => 'Done'));
        }

    }

我不知道这个文件是从哪里来的?
HTML 表单中没有任何内容 Ajax 调用中没有任何内容

可能在迁移中的某个地方,将FirstName列定义为错误告诉我们Unknown column 'tf.FirstName'。由于您控制器不对此列执行任何操作,因此我建议找到它并删除它。

表中

不存在列FirstName,但我可以看到您有一列Name也许就是那列。