<?php

namespace App\Models;

use App\Libs\Database\Eloquent\BaseModel;

class Favourite extends BaseModel
{
    protected $casts = [];

    public static $types = [
        'artist'     => Artist::class,
        'exhibition' => Exhibition::class,
        'collection' => Collection::class,
    ];


    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_id', 'favourite_id', 'favourite_type'
    ];

    /**
     * Get the parent favouritable model (artist / exhibition / collection).
     */
    public function favouritable()
    {
        return $this->morphTo('favourite');
    }
}
