List of Core Repositories

A Repository is basically a layer that helps you to interact between your project’s domain and the database and it makes your controllers more flexible and clean. Core Repositories do not have any dependencies. So you can use our core Repository methods to develop your Plugin faster. Core Repositories are located in app/Repositories/Admin and app/Repositories direcotory.

  1. UtilityRepository
  2. PluginRepository
  3. UserManagementRepository
  4. ThemeManageRepository
  5. AbuseManageRepository
  6. AdminManageRepository
  7. CreditManageReposiroty
  8. DashboardRepository
  9. EmailSettingRepository
  10. FinanceRepository
  11. GeneralManageRepository
  12. InterestManageRepository
  13. ProfileManageRepository
  14. AuthenticationRepository
  15. SocialLoginsRepository
  16. AbuseReportRepository
  17. BlockUserRepository
  18. CreditRepository
  19. ProfileRepository
  20. RegisterRepository
  21. SuperpowerRepository
  22. UserRepository

UtilityRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\UtilityRepository; in your code. All the useful method are listed below:

method return type description
session_set ($key, $value) void is used to set data in current session with key value pair. $key -> key name of data. it is string. $value -> value associated with key string. It can be any object.
session_get ($key) object used to retrive data from current session with passing key string. $key -> key string.
session_forget($key) void used to flash session data by passing key string.
set_setting ($key, $value) void used to set key and value in settings table. $key -> string value. $value -> string value.
get_setting ($key) string used to retrive settings value from settings table. $key -> is string. Returns null string if no key or value exists.
add_settings ($data) void used to add settings in settings table. $data -> is an array of key vaue pairs. Both key and value must be string.
create_supported_image_extension ($image_type) string used to get image extension like .jpg, .png. .bmp. $image_type -> is string. like image/jpg, image/png. $image_type can be only image/jpg, image/jpeg, image/png, image/bmp
generate_image_filename ($prefix, $extension) string used to generate random string with specified prefix and extension type. $prefix -> any string , $extension -> image extension name like .jpg, .png. Example : generate_image_filename ('prefix_', '.jpg') returns prefix_23bsbdc.jpg.
clearCacheViews() void used to used to remove all pre blade compiled view files form storage/framework/views directory.
copyFolder($source, $destination) void $source -> fully qualified absolute path followed by base_path() and $destination -> same as $source path. Used to copy contents from $source directory to $destination directory recursively.
validImage($image, &$ext) boolean Can be used to check wheather an image is valid or not. Valid image extensions respectively ['jpg', 'jpeg', 'png', 'bmp']. if valid image then it sets the $ext variable with appending . before extension. $image is raw binary image data.
validImageExtension($extension) boolean Can be used to check wheather a extension is valid image extension or not. $extension is any extension(string) eg. jpg, png without . before extension string.
validImageSize($image) boolean Can be used to check a image size validity set by admin. Max size is set by admin. $image is raw binary image data.

PluginRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\PluginRepository; in your code. All the useful method are listed below:

method return type description
getPlugins() object used to retrive all the Plugins. It returns an instance of Illuminate\Database\Eloquent\Collection.
getLoadedPlugins() array returns array of app\Components\PluginAbstract objects (Plugin Class) those are located in app/Plugins/PluginName directory but not yet installed.
activatePlugin ($id) void used to activate a Plugin stored in database by passing $id column value of plugins table.
deactivatePlugin ($id) void used to deactivate a Plugin stored in database by passing $id column value of plugins table.
addPlugin ($data) void used to insert a row in plugins table passing array of key value pair. $data is an array of key value pair where key is plugins table column name.

UserManagementRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\UserManagementRepository; in your code. All the useful method are listed below:

method return type description
getAllActivatedUsers() object used to retrive users except bot users. It returns an instance of Illuminate\Pagination\LengthAwarePaginator. Every page contains 100 users.
getAllDeactivatedUsers() object used to retrive deactivated users except bot users. It returns an instance of Illuminate\Pagination\LengthAwarePaginator. Every page contains 100 users.
activateUsers($userIds) void used to activate users by updating activate_user column of usertable. $userIds is an array of user ids.
deactivateUsers($userIds) void used to deactivate users by updating activate_user column of usertable. $userIds is an array of user ids.
delete_users_permenently($user_ids) void used to delete users record from all core tables. $user_ids is an array of user ids. *note : it does not fire users_deleted event.

ThemeManageRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\ThemeManageRepository; in your code. All the useful method are listed below:

method return type description
getLoadedThemes() array returns array of Parent and Child themes those are not installed. First element is an array of app\Components\ThemeInterface objects (these are all parent themes) and Second element is an array of app\Components\ThemeInterface objects (these are all child themes).
getThemes() array used to retrive all installed Parent and Child themes from database. First element is an instance of Illuminate\Database\Eloquent\Collection class contains all parent themes and second element is an instance of Illuminate\Database\Eloquent\Collection class contains all child themes.
getScreenshot ($theme_name) array used to get screenshot image of a specified $theme_name. Returns an 2 elements array where first element contains the content of raw binary data of image and second element contains the image file MimeType (can be only image/jpg, image/png, image/bmp).
activateParentTheme($theme_id) boolean used to activate a Parent theme where role column in themes table is parent and then deactivates all other child and parent themes. $theme_id is theme is respentive to themes table.
activateChildTheme($child_theme_id, $child_theme_name) boolean used to activate child theme by passing $child_theme_id(integer) and $child_theme_name(string) if and only if the activated parent theme is parent of the specified child theme.
deactivateChildTheme() boolean used to deactivate all child themes because of only one child theme can be activated at a time.
addTheme($data) void used to insert a row in themes table. $data is an array of column names and values to insert.

AbuseManageRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\AbuseManageRepository; in your code. All the useful method are listed below:

method return type description
getAllUnseenUserReports() object used to retrive all unseen user reports with count attribute. Returns instance of Illuminate\Database\Eloquent\Collection class.
getAllSeenUserReports() object used to retrive all seen user reports with count attribute. Returns instance of Illuminate\Database\Eloquent\Collection class.
getTotalUserAbuseReports() integer used to get total number of total user abuse reports.
getThisMonthUserAbuseReports() integer used to get total number of user abuse reports of current month.
getTodayUserAbuseReports() integer used to get total number of user abuse reports of current date.
setMarkSeens($ids) void used to set status seen to user abuse report records. $ids is an array of ids of userabusereports table.
setMarkUnseens($ids) void used to set status unseen to user abuse report records. $ids is an array of ids of userabusereports table.
getAllUnseenPhotoReports() void used to retrive all unseen photo abuse reports with count attribute. Returns instance of Illuminate\Database\Eloquent\Collection class.
getAllSeenPhotoReports() void used to retrive all seen photo abuse reports with count attribute. Returns instance of Illuminate\Database\Eloquent\Collection class.
getThisMonthPhotoAbuseReports () integer used to get total number of photo abuse reports of current month.
getTodayPhotoAbuseReports () integer used to get total number of user abuse reports of current date.
setMarkSeenPhotoReport($id) void used to update photo report status to seen by passing specific $id of user_photo_abuse_reports table.
setMarkUnseenPhotoReport($id) void used to update photo report status to unseen by passing specific $id of user_photo_abuse_reports table.
removePhotoReport($id) void used to delete photo from photos table which has been reported. $id refers to user_photo_abuse_reports table. If the reported photo is set as user's profile picture then sets defaut male or default female image as profile picture of that particular user.
recoverPhotoReport($id) void used to recover deleted reported photo. $id refers to user_photo_abuse_reports table. It does not set the recoverd photo as user's profile picture if the photo was set as profie picture before deleted.

AdminManageRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\AdminManageRepository; in your code. All the useful method are listed below:

method return type description
getAllAdmins() object used to retrive all admins from admin table. Returns instance of Illuminate\Database\Eloquent\Collection class.
createAdmin($data) void used to insert a row in admin table passing array of key value pair. $data is an array of key value pair where key is admin table column name.
changePassword($id, $password) void used to update admin password. $id and $password refers to admin table. $password is simple string not hash string.
deleteAdmin($id) void used to delete admin permenently from admin table where $id refers to specific admin.

CreditManageReposiroty

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\CreditManageReposiroty; in your code. All the useful method are listed below:

method return type description
getCreditPackagesForAdmin() object used to retrive all credit packages from creditPackages table including soft delete packages. Returns instance of Illuminate\Database\Eloquent\Collection class.
getSuperPowerPackagesForAdmin() object used to retrive all superpower packages from superpowerpackages table including soft delete packages. Returns instance of Illuminate\Database\Eloquent\Collection class.
getOverallCredits() integer used to get total user credits.
getCreditsPurchasedThisMonth() integer used to get total credits refilled or purchased of current month.
getCreditsPurchasedToday() integer used to get total credits refilled or purchased of current date.
getCreditsUsedOverall() integer used to get total credits deducted from users.
getCreditsUsedThisMonth() integer used to get total credits deducted from users of current month.
getCreditsUsedToday() integer used to get total credits deducted from users of current date.
credAddAll($credit) void used to credit all users with $credit is integer or number stirng.
validateCreditPackage($request_data) void used to validate http post request data while instering to creditPackages table. returns instance of Illuminate\Contracts\Validation\Validator class. $request_data comes from $request->all() method call.
addPackage($arr) void used to insert a row in creditPackages table passing array of key value pair. $arr is an array of key value pair where key is plugins table column name.
addSuperPowerPackage($arr) void used to insert a row in superpowerpackages table passing array of key value pair. $arr is an array of key value pair where key is plugins table column name.
activate($id) void used to restore soft deleted credti packages of creditPackages table.
deactivate($id) void used to soft delete credit package of creditPakages table.
superPowerActivate($id) void used to restore soft deleted credti packages of superpowerpackages table.
superPowerdeactivate($id) void used to soft delete credit package of superpowerpackages table.

DashboardRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\DashboardRepository; in your code. All the useful method are listed below:

method return type description
getTotalSignUps() integer used to get total users count from user table.
getMonthlySignUps() integer used to get total users count from user table of current month.
getDaySignUps() integer used to get total users count from user table of current date.
getCountrySignUps() array used to get total users count from user table with country. Returns an array and objects where each object having contry and count atribute, Example [0 => {country : 'india', count : 30}]
getMonthwiseSignUps() array used to get last 12 months signoups. Returns an array of key value pair where key contains year-month and value contains count of users. Example : ["2015-Apr" => 0, "2015-May" => 0, "2015-Jun" => 0]

EmailSettingRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\EmailSettingRepository; in your code. All the useful method are listed below:

method return type description
getSMTPSettings() object used to get all smtp settings eg. host, port, username etc. Returns php stdClass object with those attribues.
getMANDRILLSettings() object used to get all mandrill settings eg. host, port, username etc. Returns php stdClass object with those attribues.
setSMTPDriver() boolean used to update mail_driver to smtp in settings table if smtp mail configuration set previous.
getMailDriver() void used to get mail_driver value form settings table.
isSMTPSettingsExist() boolean used to check whether smtp mail settings are set or not.
isMANDRILLSettingsExist() integer used to check whether mandrill mail settings are set or not.
setMANDRILLDriver() boolean used to update mail_driver to mandrill in settings table if mandrill mail configuration set previous
saveEmailSettings() integer used to get total credits deducted from users of current month.
getEmailSetting($email_type) object used to get particular email setting by passing $email_type where $email_type is string. Returns instace of app\Models\EmailSettings class.
saveEmailSettings($sub, $body,$content_type,$email_type) void used to save email setting for a specified $email_type.
getEmailTemplates() array used to get all email templates file names located in resource/views/emails directory.
create_mail_id($title) string used to create a string removing [' ', ' ', '\\', '/', '*', '.'] characters.

FinanceRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\FinanceRepository; in your code. All the useful method are listed below:

method return type description
totalRevenue() integer used to get total total revenue.
getMonthlyRevenue() integer used to get total revenue of current month.
getDayRevenue() boolean used to get total revenue of current date.
getRevenueShareGender() array used to get total revenue of both male and fenale. Eg: ["male" => 1232, "female" => 2233].
getRevenueShareCountry() array used to get total revenue of country wise. Eg: ["india" => 1232, "russia" => 2233].
getRevenueSharePayment() array used to get total revenue of payment gateway wise. Eg: ["stripe" => 1232, "paypal" => 2233]
getAllTransactions() object used to get all transactions form transactions table. Returns instance of Illuminate\Database\Eloquent\Collection class.
getRevenueYear() array Returns an array of objects and each object contains year and amount attribute.

GeneralManageRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\GeneralManageRepository; in your code. All the useful method are listed below:

method return type description
saveLogo($file) void used to save website logo. $file is raw binary data comes form post request. Throws Exception if file is null or image extension does not match with .jpg, .bmp, .png
favicon($file) void used to save website favicon. $file is raw binary data comes form post request. Throws Exception if file is null or image extension does not match with .jpg, .bmp, .png
backgroundImage($file) void used to save website background image. $file is raw binary data comes form post request. Throws Exception if file is null or image extension does not match with .jpg, .bmp, .png
saveDefaultMaleImage($file) void used to save default male image. $file is raw binary data comes form post request. Throws Exception if image extension does not match with .jpg, .bmp, .png
saveDefaultFemaleImage($file) void used to save default female image. $file is raw binary data comes form post request. Throws Exception if image extension does not match with .jpg, .bmp, .png
getLimitSetting () array used to get minimum user photo to see others all photos limit settings.

InterestManageRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\InterestManageRepository; in your code. All the useful method are listed below:

method return type description
getInterests() object used to get all insterests. Returns instance of Illuminate\Pagination\LengthAwarePaginator class. Every page contains 100 results.
getTotalInterests() integer used to get total count of interests.
getUsersUsingInterests() integer used to get total count of users using the interest feature.
getTodayInterestsAddedByUser() integer used to get total count of interests added by user of currenct date.
addInterest($str) object used to add new interest in interests table and returns an instance of app\Models\Interests class.
deleteInterest($id) void used to delete interest from both interests and userinterests table by passing $id(interest id).

ProfileManageRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\ProfileManageRepository; in your code. All the useful method are listed below:

method return type description
post_add_section($name) void used to add new sections for profile page. $name is name of new section.
post_add_field($arr) void used to add new fields for a specific profile page section. $arr is associtive array contains field name, section id, type
post_add_field_option($arr) void used to add field options for a specific profile page setion field. $arr is an associative array contains option title, field id.
delete_section($id) void used to delete specified profile field section by id. $id is column of field_sections table.
delete_field($id) void used to delete specified profile field by field id. $id is column of fields table.
delete_option($id) void used to delete specified profile field option by option id. $id is column of field_options table.
make_code($name) string used to generate multilanguge file key code for a text. it removes all special characters, spaces from a string. $name is string.
addInLangFile($code,$value) void used to write keyword and text in currently activated language file. $code is language keyword and $value is text.

AuthenticationRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\AuthenticationRepository; in your code. All the useful method are listed below:

method return type description
findByUsername($username) App\Models\Admin used to get admin from admin table by $username(string).
verify_password($pass1, $pass2) boolean used to verify password. $pass1 is normal string and $pass2 is Hashed string.
set_last_login_data($admin, $data = []) void used to set last login details of admin. $admin is instance of App\Models\Admin and $data is an associative array holds basically last_login, last_ip details.
storeAdminData($data = []) void used to insert data to admin table. $data is an associate array holds key value pair repective to admin column.

SocialLoginsRepository

Located in App/Repositories/Admin directory and namespace is App\Repositories\Admin. To use this repository add use App\Repositories\Admin\SocialLoginsRepository; in your code. All the useful method are listed below:

method return type description
getAllSocialLogins() Illuminate\Database\Eloquent\Collection used to get all recoreds from social_logins table.
save_priority($arr) void used to update priority column of all social_logins records. $arr is an associative array where key holds plugin_id and value holds prioriy.

AbuseReportRepository

Located in App/Repositories directory and namespace is App\Repositories. To use this repository add use App\Repositories\AbuseReportRepository; in your code. All the useful method are listed below:

method return type description
doPhotoReport ($reporting_user_id, $reported_user_id, $reported_photo_id, $reason) void used to insert new photo report. $reporting_user_id is who is reporting, $reported_user_id is who being reported(photo owner) and $reason is text.
reportUserAbuse($reporting_user_id, $reported_user_id, $reason) void used to insert new user abuse report. $reporting_user_id is who is reporting, $reported_user_id is who being reported and $reason is text.
get_userid_photoid_by_photo_name($photo_name, &$user_id, &$photo_id) boolean used to get user id and photo id by photo name. $photo_name is string. if photo found in database then sets $user_id, $photo_id with respective values and returns true.
validate_user_id ($log_user_id, $user_id) boolean used to check wheather logged in user id and $user_id are same or not. If same then returns false otherwise returns false.

BlockUserRepository

Located in App/Repositories directory and namespace is App\Repositories. To use this repository add use App\Repositories\BlockUserRepository; in your code. All the useful method are listed below:

method return type description
getAllBlockedUsersIds($id) array used to get all blocked user ids of $id. Return array contains both ids blocked by this $id and $id itself blocked by others.
getBlockedUsers($user_id) array used to get all blocked users blocked by this $user_id. Returns an array of App\Models\User instances.
blockUser($auth_user_id, $block_user_id) void performs block a user. $auth_user_id who is blocking and $block_user_id who is being blocked.
unblockUser($auth_user_id, $block_user_id) void performs unblock a user. $auth_user_id who blocked this $block_user_id and $block_user_id who is blocked by this $auth_user_id.

CreditRepository

Located in App/Repositories directory and namespace is App\Repositories. To use this repository add use App\Repositories\CreditRepository; in your code. All the useful method are listed below:

method return type description
getPack($package) App\Models\Package used to get credit package from creditPackages table. $package is package name(string).
getPackById($id) App\Models\Package used to get credit package from creditPackages table. $id is package id(integer).
getRiseupScreenshotUrl() string used to get credit page riseup screenshot image url stored in settings table.
getCreditPackages() Illuminate\Database\Eloquent\Collection used to get all credit packages from creditPackages table.
getBalance($id) App\Models\Credit used to get credits of a user by user id. $id is user id.
getRiseupCredits() string used to get riseup credits set by admin from settings table.
transactionDetails ($gateway, $trans_id, $packid, $status, $logUser, $activity) void used to store credit refill payment transaction details. $gateway is gateway name used to pay the amount. $trans_id is transactions id. $packid is purchased package id. $status is payment status. $logUser is logged in user id.

ProfileRepository

Located in App/Repositories directory and namespace is App\Repositories. To use this repository add use App\Repositories\ProfileRepository; in your code. All the useful method are listed below:

method return type description
getLatLong($place) array used to get latitude and longitude passing a place name. $place is string , name of the place.
saveUserFields ($logId,$arr) void used to save specific user's fields data into user_fields table. logId is logged in user id and $arr is field data.
getUserFields($id) Illuminate\Database\Eloquent\Collection used to get all user filed of a specific user. $id is user id.
get_fieldsections() Illuminate\Database\Eloquent\Collection used to get all records from field_sections table.
getUserIdByPhotoName($photo_name) integer used to get user id from a photo name. $photo_name is string.
calculate_distance($from_user, $to_user) integer used to calculate distance between two users. $from_user is user one and $to_user is user two, instance of App\Models\User. Returns distance in km.
calculate_score($id) stdClass used to calculate score of a particular user. $id is user id. Returns php stdClass object that holds score, likes, dislikes attributes.
calculate_popularity($id,$max_count) integer used to calculate a users populatiry based on no of user visit and total users. $id is user id and $max_count is total user records count in user table.
isUserLiked($user_id1, $user_id2) integer used to get wheather $user_id1 liked $user_id2 or not.
isUserLikedMe ($user_id1, $user_id2) integer used to get wheather $user_id2 liked $user_id1 or not.
createVisitEntry ($loguser, $id) void used to create an entry in visitors table. $loguser is logged in user id and $id is visited user id who is visited by auth user.
updateHereTo($id, $hereto) void used to update an specific user's here to field in user table.
photo($id,$file) string used to save user's other photos. $id is user id and $file is raw binary image data. Returns photo name.
save_resize_photo($file, $fileName) void used to save photos in 4 differect places after resizeing with the photo name passed. $file is raw binary image and $fileName is the photo name.
resize_photo($image,$new_width , $new_height) Intervention\Image used to resize a iamge file with specified width and height. $image is raw binary image data, $new_width is width of new image and $new_height is height of new image.
getInterests($userid) Illuminate\Database\Eloquent\Collection used to get all user intrests of a specific user.
getSuggestions($string) json array used to get interest suggestions started with $string.
findInterest($interest) App\Models\Interests used to find an interest with string passed to this method. $interest is string.
isUserInterestExist($interest) boolean used to get wheather an interest is exists in userinterests table or not.
getInterest($str) App\Models\Interests used to get interest by passing interest text. $str is string.
addToUserInterests($id, $interestid) void used to add an interst in userinterests table. $id is user id and interestid is refers to column of interests table.
addToInterests($interest) App\Models\Interests used to add interest in interests table.
deleteInterest($userid, $interestid) void used to delete an interest from userinterests table.
getUserInterests($id) Illuminate\Database\Eloquent\Collection used to get all user interests of a specific user from usersinterests table.
isInterestExist ($user_id, $interest_id) boolean used to check wheather user intersts exists in userinterests table by passing specified interest id of interests table.
getUserPhotos($userid, $flag = false) Illuminate\Database\Eloquent\Collection used to get a specified users photos. If $flag is false returns one photo otherwise returns all photos.
canSeePhotos($userid) boolean used to check wheather a user can see other users all photos or not. $userid is the user id who can see photos or not.
getMinPhotoCount() integer used to get minimum photo to have a user to see others users photos. This minimum photo number is set by admin and stored in settings table.
getPhotoRestrictionMode() boolean used to check photo restriction mode is set or not by admin. If set then minimum no of photos to see others all photos feature will be applicable.
saveLocation($user_id, $data) void used to save location information in both user and profile table of specified user. $data is an associative array stores city, country, lat, long keys and respective values.
saveProfilePicture ($user_id, $file, $crop_width, $crop_height, $crop_x, $crop_y) string used to save profile picture of a specified user after croping the image. Image is saved in 4 locations in 4 specific dimensions. $file is raw binary image data, $crop_width, $crop_height, $crop_x, $crop_y are coordinates used to crop image into.
createPhotoEntry($user_id, $photo_name) void used to create row in photos table.
deletePhoto($auth_user_id, $photo_name) void used to delete a photo of a specified user from photos table.
changeProfilePicture($auth_user_id, $photo_name) void used to change a profile picture of a specified user. $auth_user_id is logged in user's id and $photo_name is the name of photo that has been uploaded by the same auth user already.
createDateFromFormat($date) DateTime used to create a date from $date string in format d-m-Y
saveBasicInfo ($user_id, $data) void used to save basic information like dob, hereto in user table. $data is an associative array holds key repective to user table column names.
getUserAge($user_id) integer used to retrive a specified users age.
getUserOnlineStatus($user_id) boolean used to check wheather a user is online or offline.
profileCompletePercent($id) integer used to calculate a specified users profile completion percentage.
getCommonInterests($user_id1, $user_id2) integer used to calculate no of common interests between two users. $user_id1,$user_id2 both are user ids (integer).

RegisterRepository

Located in App/Repositories directory and namespace is App\Repositories. To use this repository add use App\Repositories\RegisterRepository; in your code. All the useful method are listed below:

method return type description
isUsernameExisted($username) boolean used to check wheather a email id is registered or not. $username is email id(string).
register($arr) App\Models\User used to insert data to user table. $arr is key value pair respetive to user tables column name.
activateUser($id,$token) void used to activate a user. $id is user id and $token is a string which is sent at the time of account creation.
forgotPassword($username) void used to set password_token and send password reset mail to $username.
resetPasswordSubmit($id, $token , $password, $confirmPassword) boolean used to reset password of a user. $id is user id. $token is password token sent with mail. $password and $confirmPassword is input given by user.

SuperpowerRepository

Located in App/Repositories directory and namespace is App\Repositories. To use this repository add use App\Repositories\SuperpowerRepository; in your code. All the useful method are listed below:

method return type description
getSuperPowerPack($id) App\Models\SuperPowerPackages used to get super power package. $id super power package id of superpowerpackages table.
getSuperPowerPackages() Illuminate\Database\Eloquent\Collection used to get all super power packages from superpowerpackages table.
transactionDetails ($gateway, $trans_id, $packid, $status, $logId, $invisible) void used to store super power activate payment transaction details. $gateway is gateway name used to pay the amount. $trans_id is transactions id. $packid is purchased package id. $status is payment status. $logId is logged in user id. $invisible is users integer(0 or 1) says users invisible mode will be activated or not.
isSuperPowerActivated ($id) boolean used to check wheather super power is actiavated or not of a user. $id is user id.

UserRepository

Located in App/Repositories directory and namespace is App\Repositories. To use this repository add use App\Repositories\UserRepository; in your code. All the useful method are listed below:

method return type description
getSocialAccounts($id) Illuminate\Database\Eloquent\Collection used to get a specific user's all social media account lists.
getPhotosBySrc($user_id, $src) Illuminate\Database\Eloquent\Collection used to get a particular user's photos by source of photos. $src is social media name from where used has imported photos.
getSocialLoginBySrc($id,$src) App\Models\UserSocialLogin use to get user social login details by passing user is and social media name. $id is user id and $src is social media name.
getEmailSettings($type) App\Models\EmailSettings used to get email setting of a particular type. $type is email type.
insert_social_login($response_user, $user, $src) App\Models\Credit used to insert record when user registers from social login or adds his social account. $response_user is user's social account object, $user is instance of App\Models\Users and $src is social media name(string) like Facebook, Twitter etc.
registerValidate ($request_data) Illuminate\Contracts\Validation\Validator used to validate data after registeration using social login.
getAllUsers() Illuminate\Database\Eloquent\Collection used to get all users from user table.
getInvisibleSettings($id) array used to get invisible settings of a user. $id is user id. Return array holds hide_visitors and hide_superpowers key with respective values. values can be only 0 or 1.
getPrivacySettings($id) array used to get privacy settings of a user. $id is user id. Retur array holds online_status and show_distance key with respective values. values can be only 0 or 1.
changeEmail($user,$email) array used to get change user accounts email address. $user is App\Models\User object and $email are used by mailBodyParser() to parse and convert the mail body. Returns change mail subject and body.
changePasswordMail($user) array used to get change password mail subject and body. $user is App\Models\User object that is used by mailBodyParser() to parse and convert the mail body.
mailBodyParser($body, $user) string used to parse and convert email predefined special keywords. Eg: @website_name will be replaced with website title.
getUserById($id) App\Models\User user to get user by id. $id is user id.
getUserByEmail($username) App\Models\User used to get user by username. $username is email id.
getTitle() void used to get website title from settings table.
setFilter( $user, $filter) void used to set search filter for peoplenearby and encounters. $user is instance of App\Models\User. $filter is an associtive array holds male, female, gender, distance keys and corresponding values.