“字段列表”中的未知列“ user_id”(SQL:插入notifications
(id
,type
,data
,read_at
,user_id
,updated_at
,created_at
)
我要进行迁移的地方是这样的表:
Schema::create('notifications',function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
我没有user_id,并且查看通知(id,类型,数据)。其完全不同。
我的NotificationClass
public function via($notifiable)
{
return ['mail','database'];
}
public function toArray($notifiable)
{
return [
"message" => "this is a test","url" => "go somewhere else",];
}
不知道什么会影响插入。