<?php

namespace App\Models\GenericBackoffice;

use App\Libs\Database\Eloquent\ContentTypeModel;
use App\Models\GenericBackoffice\Traits\LanguageSupportTrait;
use App\Models\MediaItem;

class Allergen extends ContentTypeModel
{
    use LanguageSupportTrait;

    protected $hidden = ['languages', "websites"];
    protected $with = ['languages', "websites"];

    protected $dates = [];
    protected $spatialFields = [];

    protected $casts = [];

    public function food()
    {
        return $this->belongsToMany(Food::class, "food_allergen")->withPivot(['position']);
    }
}
