florida_gym/app/Models/CollectionItem.php
2026-03-11 11:03:12 +05:30

28 lines
519 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class CollectionItem extends Model
{
protected $fillable = [
'collection_id',
'product_id',
'quantity',
'unit_price',
'subtotal'
];
public function collection(): BelongsTo
{
return $this->belongsTo(Collection::class);
}
public function product(): BelongsTo
{
return $this->belongsTo(Product::class);
}
}