belongsTo(User::class); } public function product() { return $this->belongsTo(Product::class)->withDefault(function () { $product = new Product(); $product->name = '商品已下架'; $product->thumb = get404Image(); $product->price = 0; }); } }