feat: Implement order and invoice management, enhance addon features, and remove the 'Type' module.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user