<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class UserImage extends Model
{
    use HasFactory;

    protected $fillable = [
        'user_id', 
        'url',
        'is_hidden',
    ];

    protected $appends = [
        'image_url',
    ];

    public function getImageUrlAttribute(){

        return get_uploaded_image_url( $this->url, 'user_image_upload_dir', 'camera_placeholder.png' );
        
    }

}
