<?php

    namespace App\Models;

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

    class PageTab extends ContentTypeModel
    {
        use LanguageSupportTrait;

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

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

        protected $casts = [];

        public function tabBlocks() {
            return $this->belongsToMany(Block::class, 'page_tab_block')->withPivot('position');
        }

        public function block() {
            return $this->belongsToMany(Block::class)->withPivot('position')->withTimestamps();
        }
    }
