<?php

    namespace App\Models;

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

    class Card extends ContentTypeModel
    {
        use LanguageSupportTrait;

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

        protected $dates = []; // dates

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

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

        public function highlightImage() {
            return $this->belongsTo(MediaItem::class);
        }
    }
