LMIV-SNACKAUTOMAT/app/Models/SlotProduct.php

33 lines
598 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SlotProduct extends Model
{
protected $table = 'slot_product';
protected $fillable = [
'slot_id',
'product_id',
'quantity',
'current_price'
];
protected $casts = [
'current_price' => 'decimal:2',
];
public function slot(): BelongsTo
{
return $this->belongsTo(Slot::class);
}
public function product(): BelongsTo
{
return $this->belongsTo(Product::class);
}
}