belongsTo(User::class,'user_id'); } public function admin(){ return $this->belongsTo(User::class,'admin_id'); } // const path = 'https://jerichoalternatives.in/public/uploads/profile/img/'; // const filePath = 'https://jerichoalternatives.in/storage/app/chat/'; public function getProfileImageAttribute($value) { return imagePath('public/uploads/profile/img/') . $value; } public function getFileAttribute($value) { if($value) return imagePath('storage/app/chat/') . $value; } }