我使用`model::create`插入一条新的数据,提示我需要设置类型`setAttribute`,请问怎么设置类型?
我是这样创建数据的
App\GameWork::create([
"task_id" => "23571",
"type" => 2,
"take_time" => "1563085291",
"send_time" => 1563093004,
"chufa" => 10,
"worker" => 0,
"work_time" => 0,
"log" => "超时",
"uid" => 271,
"game_id" => 3532054,
"buyer_id" => 64
]);
结果提示我
TypeError: Too few arguments to function Illuminate/Database/Eloquent/Model::setAttribute(), 1 passed in /Library/WebServer/Documents/api/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php on line 617 and exactly 2 expected
有点不太明白,我使用的是 create
方法,缺提示我 setAttribute
方法错误,请问我该如何设置数据类型呢?
推荐文章: