エラー
>>> $post->save();
Illuminate/Database/QueryException with message 'SQLSTATE[HY000]: General error: 1 table posts has no column named updated_at (SQL: insert into "posts" ("body", "title", "updated_at", "created_at") values (body 1, title 1, 2020-02-02 14:58:15, 2020-02-02 14:58:15))'
対策
$timestamps無効にすれば改善される。
そのモデルに下記を追記する
public $timestamps = false;
モデル
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
public $timestamps = false;
}
確認
>>> $post = new App\Post();
=> App\Post {#2894}
>>> $post->title = 'title 1';
=> "title 1"
>>> $post->body = 'body 1';
=> "body 1"
>>> $post->save();
=> true
>>>
trueが表示されており成功している