<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Tax extends Model
{
    use HasFactory;
    protected $fillable = [
        'tax_title',
        'tax_rate', 'is_vat',
        'is_tax_fix',
        'tax_id',
        'is_tax_included',
    ];

    protected $casts = [
        'is_fix' => 'boolean',
        'is_vat' => 'boolean',
        'is_tax_fix' => 'boolean',
        'is_tax_included' => 'boolean',
    ];


    public function foodItems()
    {
        return $this->hasMany(FoodItem::class, 'tax_id');
    }
}
