38 lines
780 B
PHP
38 lines
780 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Modules\Restaurant\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||
|
|
|
||
|
|
class MenuSection extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'restaurant_id',
|
||
|
|
'menu_category_id',
|
||
|
|
'name',
|
||
|
|
'slug',
|
||
|
|
'description',
|
||
|
|
'priority',
|
||
|
|
'status',
|
||
|
|
'created_at',
|
||
|
|
'updated_at',
|
||
|
|
'deleted_at',
|
||
|
|
];
|
||
|
|
|
||
|
|
public const TABLE_NAME = 'menu_sections';
|
||
|
|
|
||
|
|
protected $table = self::TABLE_NAME;
|
||
|
|
|
||
|
|
public function menuCategory(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(MenuCategory::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function foodItems(): HasMany
|
||
|
|
{
|
||
|
|
return $this->hasMany(FoodItem::class);
|
||
|
|
}
|
||
|
|
}
|