<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class File
 * @package App\Models
 * @version August 4, 2020, 4:36 am
 *
 * @property \App\Models\Document document_id
 * @property text file
 * @property int file_type_id
 */
class File extends AbstractModel
{
    use SoftDeletes;

    protected $table = 'files';

    protected $fillable = ['file'];

    protected $dates = ['deleted_at'];

    public function getFileAttribute($value)
    {
        return $value ? json_decode($value) : [];
    }
}
