可是在额外的字段如何传值?
migration 文件
Schema::create('notifications', function (Blueprint $table) {
$table->increments('notifa_id');
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->integer('from_uid'); //额外字段 用来存储是谁发送的
$table->timestamps();
});
报出了错误
SQLSTATE[HY000]: General error: 1364 Field 'from_uid' doesn't have a default value (SQL: insert into `juda_notifications` (`id`, `type`, `data`, `read_at`, `notifiable_id`, `notifiable_type`, `updated_at`, `created_at`) values (74e40a5d-d28b-49dc-82c2-f82308ad61ed, App\Notifications\ZhanNeiXinNotifaction, {"name":"\u8d85\u7ea7\u7ba1\u7406\u5458","title":"\u6d4b\u8bd5","content":"\u4f46\u662f\u5927\u591a\u6570","target":"1","send_uid":1}, , 5, App\Model\Admin, 2017-06-26 17:20:51, 2017-06-26 17:20:51))