$query = Role::join('users', 'roles.id', '=', 'users.role_id'); $user = User::all(); $users = $query->select('users.*', 'roles.name as role_name')->where('users.deleted_at', null)->paginate(10);