<?php

    namespace App\Models;

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

    class SingleVersion extends ContentTypeModel
    {
        use LanguageSupportTrait;

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

        protected $dates = []; // dates

        protected $casts = [];

        public function versionDownloads() {
            return $this->belongsToMany(Download::class, 'single_version_downloads', 'single_version_id', 'download_id')->withPivot('position')->withTimestamps();
        }

        public function tabItem() {
            return $this->belongsToMany(TabItem::Class)->withPivot('position');
        }
    }
