Appearance
User
Retrieve users
php
use Carro\SsoClient\Facades\User;
// get all the users
User::all();
// get all the users with pagination
User::paginate($perPage = 15, $page = null);
// find a user with id
User::find($id);
// authenticated user
auth('carro')->user();Users with condition
php
use Carro\SsoClient\Facades\User;
User::where('role_name', 'admin');
User::whereIn('role_name', ['admin']);
// eg
User::where('role_name', 'admin')->all();Search user by email
php
use Carro\SsoClient\Facades\User;
// find a user by email
User::searchUserByEmail('admin@carro.co');Sync roles by user_id
php
use Carro\SsoClient\Facades\User;
$roles_id = [1,2,3];
// Sync or update roles with user
// @return Role
User::syncRolesById($userId, $roles_id);Attach application by user_id
php
use Carro\SsoClient\Facades\User;
// @return User
User::attach($user);