Users

User Management is a system for authenticating users and storing user data. As of now, VaahCms has two Login option: Login via Password and Login via OTP. In VaahCms, you can manage all aspects of your user accounts such as changing user properties, reset passwords, enable or disable users, and more.

Visit following url you will see the Users section:

<project-url>/backend#/vaah/users/

# User Listing

Get a list of all your users and their data in one place. The Users table contains all of your user data and the VaahCms puts all user management functions right at your fingertips. You have the ability to add, edit, and delete users. You can also search, sort, and filter your user data and modify user information and roles, all in the same place.


# Create New Users

You can create new user accounts within your app in Users section. VaahCms give you total control over how users get created. You decide the level of access they receive within your app.


# Password Reset

Your users need the ability to change their password without contacting you, the Administrator. Don’t waste time manually assisting users that lose or forget their password. If you need to handle a password change yourself, you can do it from Backend.


# Manage Roles

You can assign roles to a user in Users section. By clicking on Role column, a page will open that contain list of Roles along with Yes/NO Button.


# Available Methods

# Accessors

To know about Accessors, see Laravel Documentation


# Mutators

To know about Mutators, see Laravel Documentation


# Scopes

To know about Scopes, see Laravel Documentation


# Relationships

To know about Relationships, see Laravel Documentation


# Non Static

# Static

# create

Parameters: $request

copy

Creates a new user for the database on which the method is run. \WebReinvent\VaahCms\Entities\User::create($request); returns a duplicate user error if the email already exists in the User table.


# postStore

Parameters: $request

copy

Update an existing user in the database. \WebReinvent\VaahCms\Entities\User::postStore($request); returns a duplicate user error if the updated email id already exists in the User table.


# validation

Parameters: $inputs

copy

This is a method for validate user's following columns: email, first_name, is_active, status which use Laravel Validator.


# getList

Parameters: $request

copy

This getList method that returns a list of Users, total number of roles in vh_roles table and status of method. The list of User are Paginated. There is one parameter $request which has following values:

  • page: This contain numbers which is used to get data of that page number in pagination.
  • q: This contain string which is used to search in vh_users table by id, email, first_name, middle_name, last_name
  • trashed: This contain boolean values. If trashed value is true, it will return list of all Users including trashed User.
  • status: This contain string. If status value is 01, it will return list of all Active Users.
  • from,to: Both contain date. If there value is set, it will return list of Users who is created in between these dates.
  • roles: This contain array of role slug. If there is some role in this array, it will return list of Users who has that role.

# getItem

Parameters: $id

This getItem method find user only by the id and relation with createdByUser. updatedByUser. deletedByUser method. If someone is logged in and that user has can-see-users-contact-details permission then you will get some extra columns: email, alternate_email, phone


# getItemRoles

Parameters: $request, $id

copy

This getItemRoles method find user by the id and get the list of their associated roles. There is a parameter $request which has following values:

  • page: This contain numbers which is used to get data of that page number in pagination.
  • q: This contain string which is used to search in vh_roles table by name, slug.

# bulkStatusChange

Parameters: $request

copy

This method is used to change the status of Users. There is one parameter $request which has following values:

  • inputs: This contain array of User's id which is used to find user by the id and update status.
  • data: This is also a array which has one value status. It has new updated status of User
  • action: This is a action name which is used to check restricted action.

# bulkTrash

Parameters: $request

copy

This method is used to soft delete the Users. There is one parameter $request which has following values:

  • inputs: This contain array of User's id which is used to find user by the id and update status.
  • data: This is also a array which has one value status. It has new updated status of User
  • action: This is a action name which is used to check restricted action.

# bulkRestore

Parameters: $request

copy

This method is used to restore the Users. There is one parameter $request which has following values:

  • inputs: This contain array of User's id which is used to find user by the id and update status.
  • data: This is also a array which has one value status. It has new updated status of User
  • action: This is a action name which is used to check restricted action.

# bulkDelete

Parameters: $request

copy

This method is used to permanently delete the Users. There is one parameter $request which has following values:

  • inputs: This contain array of User's id which is used to find user by the id and update status.
  • data: This is also a array which has one value status. It has new updated status of User
  • action: This is a action name which is used to check restricted action.