37 lines
650 B
PHP
37 lines
650 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CartAddon extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'cart_addons';
|
|
|
|
protected $fillable = [
|
|
'cart_id',
|
|
'addon_id',
|
|
'qty',
|
|
'price',
|
|
];
|
|
|
|
/**
|
|
* Relationship: CartAddon belongs to Cart
|
|
*/
|
|
public function cart()
|
|
{
|
|
return $this->belongsTo(Cart::class, 'cart_id');
|
|
}
|
|
|
|
/**
|
|
* Relationship: CartAddon belongs to Addon
|
|
*/
|
|
public function addon()
|
|
{
|
|
return $this->belongsTo(Addon::class, 'addon_id');
|
|
}
|
|
}
|