belongsTo(User::class); } protected $appends = ['url', 'image_url']; // Accessor for full URL public function getUrlAttribute() { return asset('storage/' . $this->file_path); } public function image() { return $this->belongsTo(Image::class, 'image_id'); } public function getImageUrlAttribute() { return $this->image ? asset('storage/' . $this->image->path) : null; } }