<?php

namespace App\Models;

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


class CollectionCatalogue extends ContentTypeModel
{
    use LanguageSupportTrait;


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

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

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