I am trying to insert information in the database. And i have the error
column not found: Unknown column 'updated_at' in 'field list'
I donot have that column in my database.
model
<?php
namespace App;
class quiz extends Basemodel {
protected $primaryKey = 'qid';
protected $table = 'quiz';
protected $fillable = array('question', 'opt1', 'opt2','opt3','opt4','answer','category', 'level');
}
controller
public function store(Request $request)
{
$input =$request->all();
$q=new quiz();
$q->question=$input['question'];
$q->answer=$input['answer'];
$q->opt1=$input['opt1'];
$q->opt2=$input['opt2'];
$q->opt3=$input['opt3'];
$q->save();
}
set public $timestamp = false;
in your model
Yes, as Adam mentioned,
Set public $timestamp = false;
in your model
Or else, add this line in the Model file.
protected $hidden = ['updated_at'];