【发布时间】:2019-10-25 13:47:33
【问题描述】:
我正在尝试用 faker 播种我的数据库。除图像外,所有内容均已正确填写。它们存在于我的存储文件夹中,但在数据库中写入为 0。我很困惑,我已经查看了此处提供的问题/答案,但我没有找到解决方案。 任何帮助将不胜感激。
型号:
protected $fillable = [
'title','description','image','price','category_id','user_id'
];
工厂:
'image' => $faker->image(storage_path('app/public/products'), 800, 800, null, false),
迁移:
$table->string('image')->nullable();;
【问题讨论】: