<?php

namespace Modules\Settings\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;

class Attachment extends Model
{
    /**
     * The attributes that are mass assignable.
     */
    protected $fillable = [
        'file_name',
        'file_path',
        'document_type',
        'is_visible'
    ];

    protected $casts = [
        'is_visible' => 'boolean',
    ];

    public function attachable(): MorphTo
    {
        return $this->morphTo();
    }
}
