Closed noecs closed 4 years ago
已修復,可以再試試看!
似乎在迁移订单表的时候又出现了一些错误:
ErrorException : Trying to get property of non-object
at /Users/noecs/Project/Laravel-shop/database/factories/OrderItemFactory.php:14
10| $sku = $product->skus()->inRandomOrder()->first();
11|
12| return [
13| 'amount' => random_int(1, 5), // 购买数量随机 1 - 5 份
> 14| 'price' => $sku->price,
15| 'rating' => null,
16| 'review' => null,
17| 'reviewed_at' => null,
18| 'product_id' => $product->id,
我学习到了很多
嗯......你可以試試看將資料庫重新遷移&注入資料
php artisan migrate:fresh --seed
看看還會不會有問題
我也學到了不少啊...... Laravel admin 擴展實在不少的坑,原本想用官方提供的欄位就可以完成 SKU,但就是有很多 Bug,最後決定用 Vue 才勉強做出來 :relieved:。
我遇到的问题:我执行
php artisan db:seed
的时候,收到了以下错误: mysql version: 8.0 php version:7.3.1 os:macOS mojave 10.14.5