ssquare
1 year ago

Data Missing ERROR!!

Posted 1 year ago by ssquare

I am trying to insert data to the table as follows:

FEC::create($fec_arr);

dd($fec_arr) returns

array:22 [
  "cmte_id" => "C00343863"
  "amndt_ind" => "N"
  "rpt_tp" => "Q3"
  "transaction_pgi" => "P"
  "image_num" => "27990795810"
  "transaction_tp" => "15"
  "entity_tp" => "IND"
  "name_voter" => "HOETGER, JACQUELINE Middle_ini Midlle mr."
  "mailing_address_city" => "FENTON"
  "mailing_address_state" => "MI"
  "mailing_address_zip" => "48430"
  "employer" => "SELF"
  "occupation" => "MOTT MEDIA"
  "donation_date" => "2007-08-30 12:00:00"
  "donation_id" => "A-C39094"
  "fec_federal_num" => "307489"
  "fec_memo_cd" => ""
  "fec_memo_text" => ""
  "fec_sub_id" => "4.10E+18"
  "name_last" => "HOETGER"
  "base_voter_id" => 5
  "created_by" => 1
]

Columns List in FEC Modal

            $table->increments('id');
            $table->string('cmte_id')->nullable(); 
            $table->string('amndt_ind')->nullable(); 
            $table->string('rpt_tp')->nullable(); 
            $table->string('transaction_pgi')->nullable();
            $table->string('image_num')->nullable(); 
            $table->string('transaction_tp')->nullable(); 
            $table->string('entity_tp')->nullable(); 
            $table->string('name_last')->nullable();
            $table->string('name_voter')->nullable();

            $table->string('mailing_address_city')->nullable(); 
            $table->string('mailing_address_state')->nullable(); 
            $table->string('mailing_address_zip',30)->nullable();

            $table->string('employer')->nullable(); 
            $table->string('occupation')->nullable();

            $table->date('donation_date')->nullable(); 
            $table->float('donation_amount',20,2)->nullable();
            $table->string('donation_id')->nullable(); 

            $table->string('fec_other_id')->nullable(); 
            $table->string('fec_federal_num')->nullable(); 
            $table->string('fec_memo_cd')->nullable(); 
            $table->text('fec_memo_text')->nullable(); 
            $table->string('fec_sub_id')->nullable(); 

            $table->unsignedInteger('base_voter_id');
            $table->foreign('base_voter_id')->references('id')->on('base_voter');
            $table->unsignedInteger('created_by')->nullable();
            $table->foreign('created_by')->references('id')->on('users');
            $table->unsignedInteger('updated_by')->nullable();
            $table->foreign('updated_by')->references('id')->on('users');
            $table->softDeletes();
            $table->timestamps();

I am getting error as Data Missing. What I am doing wrong here?

Please sign in or create an account to participate in this conversation.