36 lines
757 B
PHP
36 lines
757 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Modules\Restaurant\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class Addon extends Model
|
||
|
|
{
|
||
|
|
use SoftDeletes;
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'restaurant_id',
|
||
|
|
'name',
|
||
|
|
'price',
|
||
|
|
'vat',
|
||
|
|
'pst',
|
||
|
|
'status',
|
||
|
|
'created_at',
|
||
|
|
'updated_at',
|
||
|
|
'deleted_at',
|
||
|
|
];
|
||
|
|
|
||
|
|
public const TABLE_NAME = 'addons';
|
||
|
|
|
||
|
|
protected $table = self::TABLE_NAME;
|
||
|
|
|
||
|
|
public function foodItems(): BelongsToMany
|
||
|
|
{
|
||
|
|
return $this->belongsToMany(FoodItem::class, 'addon_food', 'addon_id', 'food_item_id')
|
||
|
|
->using(AddonFood::class)
|
||
|
|
->withTimestamps();
|
||
|
|
}
|
||
|
|
}
|