Basically,
I'm running this in php artisan tinker
$article = new App/articles;
$article->article_name = "My Story";
$article->article_content = "Today was a good day..";
$article->save();
The last statement $article->save()
throws a Illuminate\Database\QueryException with message
SQLSTATE[42S22]:Column not found: Unknown column 'updated_at' in 'field list' (SQL: insert into
articles
(article_name
,updated_at
,created_at
)
Which basically tries to insert data into an old table/model of the same name which i had created and dropped from mysql.
Why Does Laravel keep remembering the old table column details?
Is there a way i can flush this memory?
I've tried php artisan cache:clear
but that does'nt seem to clear this particular type of cache
The created_at
and updated_at
columns are used by Eloquent by default, you need to disable this functionality by setting the $timestamps
property on your model to false.
class Article extends Eloquent {
protected $timestamps = false;
}