<?php

    namespace App\Models;

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

    class Publication extends ContentTypeModel
    {
        use LanguageSupportTrait;

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

        protected $dates = ['publication_date'];

        protected $casts = ['block_title' => 'array'];

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