List of Core Models

A Model is what connects your application to the Database. Core Models can be used to query the database or creating an entry in one. Core Models are located in app/Models direcotory.

  1. Admin
  2. BlockUsers
  3. Credit
  4. CreditHistory
  5. FacebookFriends
  6. FieldOptions
  7. FieldSections
  8. Fields
  9. Interests
  10. NotificationSettings
  11. Notifications
  12. Package
  13. Photo
  14. PhotoAbuseReport
  15. Plugins
  16. Profile
  17. Settings
  18. SocialLogins
  19. SuperPowerPackages
  20. SuperpowerHistory
  21. Themes
  22. Transaction
  23. User
  24. UserAbuseReport
  25. UserFields
  26. UserInterests
  27. UserSettings
  28. UserSocialLogin
  29. UserSuperPowers

Admin

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Admin; in your code. The attributes are listed below.

Attribute Type Description
username varchar It stores the username for all admins .
password varchar It stores the password for all admins .
name varchar It stores the name of all admins .

BlockUsers

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\BlockUsers; in your code. The attributes are listed below :

Attribute Type Description
user1 integer It contains the user id of the logged in user who is blocking another user.
user2 integer It contains the user id of the blocked user.

All the relationship methods are listed below:

method return type description
user() App\Models\User Can be used to get the User object of the blocked user .

Credit

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Credit; in your code. The attributes are listed below

Attribute Type Description
userid integer It contains the user id of all users.
balance integer It contains the total credit balance corresponding to the user id.

CreditHistory

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\CreditHistory; in your code. The attributes are listed below:

Attribute Type Description
userid integer It contains the user id of the user.
credits integer It contains the amount of credits used for an activity
transTable_id integer It contains the transaction id for an activity using credits
activity varchar It contains the information that gives what the transaction was used for.

All the relationship methods are listed below:

method return type description
user() App\Models\User Can be used to get the user object of the userid associated with the model's row
transaction() App\Models\Transaction Can be used to get the transaction object of the transTable_id associated with the model's row

FacebookFriends

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\FacebookFriends; in your code.The attributes are listed below:

Attribute Type Description
user1 integer It contains the user id of the logged in user
user2 integer It contains user id of the user's who have used facebook for logging in to the website and are friends with the logged in user.

FieldOptions

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\FieldOptions; in your code. The attributes are listed below:

Attribute Type Description
field_id integer It contains the corresponding field id to the field option
name varchar It contains the value of the field option.
code varchar It contains a string that is to be used while displaying the translated field option in the view .

FieldSections

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\FieldSections; in your code. The attributes are listed below:

Attribute Type Description
name text It contains the name of the field section
code text It contains a string that is to be used while displaying the translated field section in the view .

All the relationship methods are listed below:

method return type description
fields() App\Models\Fields Can be used to get Illuminate\Database\Eloquent\Collection class object, containing all fields associated with the section_id of the row.

Fields

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\fields; in your code. The attributes are listed below :

Attribute Type Description
name text It contains the name of the field
code text It contains a string that is to be used while displaying the translated field in the view .
section_id integer It contains the section id that the field belongs to.
type enum('dropdown', 'text', 'textarea') It contains the type of the field that the admin has added .

All the relationship methods are listed below:

method return type description
field_options() App\Models\FieldOptions Can be used to get Illuminate\Database\Eloquent\Collection class object, containing all field options associated with the field_id of the row.
user_field($id) string or boolean Can be used to get the value of the current field row of any user with $id being the user id. If a field with the current field id does not exist it return false.

Interests

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Interests; in your code. The attributes listed below are :

Attribute Type Description
interest varchar It contains the name of the interest added by all the users

All the relationship methods are listed below:

method return type description
userinterests() App\Models\UserInterests Can be used to get Illuminate\Database\Eloquent\Collection class object, containing all userinterests with the current interest id.

NotificationSettings

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\NotificationSettings; in your code. The attributes listed below are :

Attribute Type Description
userid integer It contains the user id of the logged in user
type varchar It contains the type of the notification settings that is added
browser integer It is either set to 1 if browser notifications are to be active or 0 if the browser notifications are not needed
email integer It is either set to 1 if email notifications are to be active or 0 if the email notifications are not needed

Notifications

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\; in your code. The attributes listed below are:

Attribute Type Description
from_user integer It contains the logged in user id who is responsible for making the notification entry.
to_user integer It contains user id of the user who is going to receive the notification.
type varchar It contains the type of the notification
status varchar It denotes if the notification status is seen or unseen.
entity_id varchar It contains the user id that is to be referenced according to the type of the notification

All the relationship methods and functions are listed below:

method return type description
clear($type) void This function is used to set all notifications for the logged in user to 'seen' according to $type.
get_count($type) integer This function is used to get the count of all notifications for the logged in user according to $type with status set as 'unseen'.
latest_notifications($logId) App\Models\Notifications This function is used to get the last notification for the logged in user. It contains name, age and profile_pic_url of the user who was responsible for creating the notification
add_formatter($type,$func) void This function pushes the type and fucntion hook to different arrays.
formatter($type,$notif) void This function passes $notif to the function in $formatters array and returns the model object.

Package

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Package; in your code. The attributes are listed below

Attribute Type Description
amount decimal(20,2) It stores the amount to be charged for the credit package
credits integer It contains the number of credits to be added according to the credit package
packageName varchar It contains the name of the credit package

Photo

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Photo; in your code. The attributes are listed below.

Attribute Type Description
userid integer It contains the user id of the user the photo belongs to
source_photo_id integer It contains the source id of the photo if the photo has come from a social networking plugin like facebook,google etc
photo_source varchar It contains the name of the social networking site related to the photo
photo_url varchar It contains the file name of the photo as saved in the server.

PhotoAbuseReport

Located in App/Models directory and namespace is App\Models. To use this repository add use App\Models\PhotoAbuseReport; in your code. The attributes are listed below

Attribute Type Description
reporting_user integer It contains the id of the user who has reported the photo
reported_user integer It contains the id of the user against whom the reporting user reported.
reported_photo integer It contains the reported photo's id of the row in photos table.
reason text It contains the reason for reporting the photo.
status varchar It either contains the status as 'seen' if seen by the admin or 'unseen'.

All the relationship methods are listed below:

method return type description
reportingUser() App\Models\User Can be used to get the user model object of the reporting user.
reportedUser() App\Models\User Can be used to get the user model object of the reported user.
photos() App\Models\Photo Can be used to get the photos model object of the reported photo.

Profile

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Profile; in your code. The attribiutes are listed below:

Attribute Type Description
userid integer It contains the id of the user corresponding to the profile
prefer_gender varchar It contains the prefferred dating gender of the user.
prefer_age varchar It contains the orefferred dating age of the user.
prefer_gender_nearby varchar It contains the prefferred gender the user wants to see in people near by
prefer_age_nearby varchar It contains the prefferred age the user wants to see in peoplenear by
prefer_distance_nearby integer It contains the prefferred distance the user wants to see the people in people near by
popularity float It stores the popularity of the user based on the number of visitors to his profile.
latitude float It contains the latitudinal localtion of the user set from his profile page.
longitude float It contains the longitudinal localtion of the user set from his profile page.

Plugins

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Plugins; in your code. The attributes are listed below:

Attribute Type Description
name varchar It contains the name of the plugin
isactivated varchar It contains whether the plugin is activated or not.
author varchar It contains the name of the person/organisation who has made the plugin.
description varchar It contains a description about the plugin.
version varchar It contains the version of the plugin.
website varchar It contains the website link to the site where the plugin is being used.
is_core varchar It is either set to 1 if the plugin is a core plugin or 0 otherwise.

Settings

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Settings; in your code. The attributes are listed below:

Attribute Type Description
admin_key varchar It contains the key of the setting set by the admin
value varchar It contains the value corresponding to the key.

All the methods 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.
get($key) App\Models\Settungs Can be used to get the Settings model object corresponding to the key passed by the user as argument.
set($key,$value) void Can be used to set a key => value pair inside the settings table by passing the two as arguments.
_get($key) varchar Can be used to get the value corresponding to the key. If value is null or the key is not present in the settings table it returns an empoty string..

SocialLogins

Located in App/Models directory and namespace is App\Models. To use this repository add use App\Models\SocialLogins; in your code. The attributes are listed below:

Attribute Type Description
name varchar It contains the name of the social login plugin
plugin_id integer It contains id of the installation plugin entry in the plugins table.
priority integer It contains the priority of the display as set by the admin for login in the landing page.

SuperpowerPackages

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\SuperpowerPackages; in your code. The attributes are listed below:

Attribute Type Description
package_name varchar It contains the package name of the super power
amount decomal(20,2) It contains the amount the user has to pay for this superpower.
duration integer It contains the duration (in days), the super power will be activated for the user.

SuperPowerHistory

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\SuperPowerHistory; in your code. The attributes are listed below:

Attribute Type Description
user_id integer It contains the user id of the user activating the super power.
trans_table_id integer It contains the id of the transaction table which stores the payment details.
superpower_package_id integer It contains the superpower package id that the user wants activated.

All the useful methods are listed below:

Attribute Type Description
admin_key varchar It contains the key of the setting set by the admin
value varchar It contains the value corresponding to the key.
method return type description
user() App\Models\User Can be used to get the user model object corresponding to the user_id in this table
transaction() App\Models\Transaction Can be used to get the model object corresponding to the trans_table_id of the table row

Themes

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Themes; in your code. The attributes are listed below:

Attribute Type Description
name varchar It contains the name of the theme.
isactivated varchar It contains whether the theme is activated or not.
author varchar It contains the name of the person/organisation who developed the theme.
description varchar It contains the description of the theme.
version varchar It contains the version of the theme.
website varchar It contains the website link for the theme.
role varchar It is set to 'parent' if its a parent theme or 'child' otherwise.

Transaction

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\Transaction; in your code. The attributes are listed below:

Attribute Type Description
gateway varchar It contains the name of the gateway used for payment.
transaction_id varchar It contains the transaction id generated while paying.
amount integer It contains the amount paid for the transaction.
status integer It contains the response status of the callback on payment.

All the useful methods are listed below:

method return type description
creditHistory() App\Models\CreditHistory Can be used to get the creditHistory model object corresponding to the id of the current row in transaction table.

User

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\User; in your code. The attributes are listed below:

Attribute Type Description
username varchar It contains the email id of the user that is used for logging in.
password varchar It contains the hashed password of the user.
gender varchar It contains user's gender(M for Male, F for Female).
dob date It contains the date of birth of the user.
city varchar It contains the city the user is from.
country varchar It contains the country the user is in.
hereto varchar It contains the information as to what the user is looking for in the site.
profile_pic_url varchar It contains the filename of the profile image of the user.
expired_at timestamp It contains the expiration date of the user's superpower if activated.
activate_token varchar It contains the activation token generated on registration.This is referred to when the user activates their account.
activate_user varchar It contains whether the user is 'activated' or 'deactivated'.
register_from varchar It contains the information for the source of registration like google,facebook etc
veified varchar It contains whether the user is 'verified' by the admin or not.
latitude float It contains the latitudinal location of the user at the time of registration.
longitude float It contains the longitudinal location of the user at the time of registration.
name varchar It contains the user's name.
language varchar It contains the selected language by the user.
last_request timestamp It contains the timestamp of the last logged in activity of the user. This is used to see whether the user is online or not

All the useful methods are listed below:

method return type description
profile() App\Models\Profile Can be used to get profile details corresponding to the user id.
userinterests() App\Models\UserInterests Can be used to get the UserInterests model object of the current user id.
spot() App\Models\Spotlight Can be used to get the spotlight model object of the current user id
riseup() App\Models\RiseUp Can be used to get the RiseUp model object of the current user id
credits() App\Models\Credit Can be used to get the Credit model object of the current user id
match() App\Models\Match Can be used to get the Match model object containing all the matched users of the current user id
visitor() App\Models\Visitor Can be used to get the Visitor model object containing all the visited users of the current user id
encounter() App\Models\Encounter Can be used to get the Encounter model object containing all the encounterred users of the current user id .
photos() App\Models\Photo Can be used to get the Photo model object containing all the photos of the current user id .
age() integer Can be used to get the age of the current user.
getFormatedDOB() date Can be used to get the date of birth of the current user in date (d-m-Y) format.
getJoining() date Can be used to get the joining date of the user in date(d-m-Y) format.
getFormatedUpdatedAt() date Can be used to get the updated at of the user in date (D, dS - M - Y h : i : s A) format.
getFormatedDeletedAt() App\Models\Profile Can be used to get the deleted at of the user in date(D, dS - M - Y h : i : s A) format.
riseupDate() Timestamp Can be used to get the updated at attribute for rise up of the current user.
profile_pic_url() link Can be used to get the link to the original profile pic of the user .
thumbnail_pic_url() linke Can be used to get the link to the thumbnail profile pic of the user.
encounter_pic_url() link Can be used to get the link to the encounter profile pic of the user.
others_pic_url() link Can be used to get the profile pic of the user with dimensions as uploaded originally.
user_super_powers() App\Models\UserSuperPowers Can be used to get the UserSuperPowers model object of the current user.
isSuperPowerActivated () boolean Can be used to get the activation status of the current user's superpower. (true or false)
superpowerdaysleft() integer Can be used to get the number of days left for the user's superpower to expire.
isInvisible() boolean Can be used to get if the invisible mode of the user is activated or not. (true or false)
onlineStatus() boolean Can be used to get the online status of the user. (true or false)
blocked_users() App\Models\BlockedUsers Can be used to get a model object containing the user id's of all the user's blocked by the current user.
users_blocked_me() App\Models\BlockedUsers Can be used to get a model object containing the user id's of all the user's who has blocked the current user.
blocked_by_auth_user() boolean Can be used to get if the current user has been blocked by Auth::user or not.
blocked_auth_user() boolean Can be used to get if the current user has blocked Auth::user or not.
settings() App\Models\UserSettings Can be used to get a UserSettings model object containing all the user settings set by the current user.
settings_get($key) Can be used to get the value corresponding to the key of the current user. If a value is not present it returns 0.
settings_save($key,$value) Can be used to set the key and value in user_settings table of the current user.
social_login_links() App\Models\UserSocialLogin Can be used to get a model object containing all the social logins connected by the current user in the site.
get_social_links() array Can be used to get an array containing the names of all the linked social networking sites.
is_social_verified() boolean It returns true for the current user if any one of the social networking site is linked or else false.

UserAbuseReport

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\UserAbuseReport; in your code. The attributes are listed below:

Attribute Type Description
reporting_user integer It contains the id of the reporting user.
reported_user integer It contains the id of the reported user.
reason varchar It contains the reason for reporting as given by the reporting user.
action varchar It contains the status as seen or unseen by the admin.

All the useful methods are listed below:

method return type description
reportingUser() App\Models\User Can be used to get the User model object of the corresponding reporting user.
reportedUser() App\Models\User Can be used to get the User model object of the corresponding reported user.

UserFields

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\UserFields; in your code. The attributes are listed below:

Attribute Type Description
user_id integer It contains the user id for the corresponding entry in the table.
value text It contains the value of the corresponding custom user field set by the user. If the field type is dropdown, then it contains the id of the corresponding field option value
field_id integer It contains the id of the field set by the user.

UserInterests

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\UserInterests; in your code. The attributes are listed below:

Attribute Type Description
userid varchar It contains the id of the user who has added his/her interest.
interestid integer It contains the id of the interest from the interests table that the user has added.

All the useful methods are listed below:

method return type description
interests() App\Models\Interests Can be used to get the value of the interest corresponding to the interest id.

UserSettings

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\UserSettings; in your code. The attributes are listed below:

Attribute Type Description
userid varchar It contains the id of the user who has saved his/her user settings.
key varchar It contains the key that will be used to retrieve the value the user has set.
value varchar It contains the value that the user has set for the corresponding key.

UserSocialLogin

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\UserSocialLogin; in your code. The attributes are listed below:

Attribute Type Description
userid integer It contains the user id of the logged in user from the social login.
src varchar It contains the name of the social login used by the user for logging in.
src_id varchar It contains the user id of the user that is used in the corresponding social networking site.

All the useful methods are listed below:

method return type description
user() App\Models\User Can be used to get the user model object of the corresponding user id from UserSocialLogin object.

UserSuperPowers

Located in App/Models directory and namespace is App\Models. To use this model add use App\Models\UserSuperPowers; in your code. The attributes are listed below:

Attribute Type Description
user_id integer It contains the user id of the user activating the superpower's.
invisible_mode integer It contains 1 if the user has activated the invisible mode or else 0.
hide_superpowers integer It contains 1 if the user wants to hide its superpower's from everyone else or else 0.
expired_at timestamp It contains the timestamp for when the user's superpower's will expire.