<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;
use \App\Models\traits\SetConnection;

class TempImageLease extends Model
{
    use SetConnection;

    protected $fillable = [
        'lease_id', 'file_path', 'file_type'
    ];

    const CREATED_AT = null;
    const UPDATED_AT = null;

    public function lease()
    {
        return $this->belongsTo(Lease::class, "lease_id", "id");
    }

    public function getStorageLinkAttribute()
    {
        return str_replace('public', '/storage', $this->attributes["file_path"]);
    }
}
