✏️ 编辑:ProductVariation.php
路径:
/home/boguraj1/.trash/app/Models/ProductVariation.php
大小:531 B · 修改:2026-07-23 16:13:46 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class ProductVariation extends Model { protected $fillable = ['product_id', 'type', 'value', 'price_adjustment', 'stock', 'status']; protected $casts = [ 'price_adjustment' => 'decimal:2', 'status' => 'boolean', ]; public function product() { return $this->belongsTo(Product::class); } public function getLabelAttribute() { return ucfirst($this->type) . ': ' . $this->value; } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF