property_id . '/' . $this->photo_name . '_1024x768.' . $this->file_ext; $photoUrlThumbFilePath = Config::get('app.fileSystemDriver') . '/property-photos/' . $this->property_id . '/' . $this->photo_name . '_200x200.' . $this->file_ext; if (File::exists($photoUrlFilePath)) { $photoUrlFilePath = Config::get('app.imageUrl') . '/property-photos/' . $this->property_id . '/' . $this->photo_name .'_1024x768.' . $this->file_ext; }else { $photoUrlFilePath = Config::get('app.imageUrl') . '/property-photos/' . $this->property_id . '/' . $this->photo_name .'_medium.' . $this->file_ext; } if (File::exists($photoUrlThumbFilePath)) { $photoUrlThumbFilePath = Config::get('app.imageUrl') . '/property-photos/' . $this->property_id . '/' . $this->photo_name .'_200x200.'. $this->file_ext; }else { $photoUrlThumbFilePath = Config::get('app.imageUrl') . '/property-photos/' . $this->property_id . '/' . $this->photo_name .'_thumbnail.'. $this->file_ext; } $photoTypes = [ 'default' => Config::get('app.imageUrl') . '/property-photos/' . $this->property_id . '/' . $this->photo_name . '.' . $this->file_ext, 'thumb' => $photoUrlThumbFilePath, 'fixed' => $photoUrlFilePath, ]; return $photoTypes; } // Config::get('app.imageUrl') . '/property-photos/' . $params['property_id'] . '/' .$value['property_photo']['photo_name'] . '.' . $value['property_photo']['file_ext'] public function propertyRooms() { return $this->hasMany('App\Models\PropertyRoomPhotoMapping', 'photo_id', 'id'); } public function propertyPlaces() { return $this->hasMany('App\Models\PropertyPlacePhotoMapping', 'photo_id', 'id'); } }