- if (strtolower(trim($confirm)) === 'yes')
- {
- $totalUsers = $this->user->count();
- $users = $this->user->where('system_name', '=', null)->with('roles')->get();
- foreach ($users as $user)
- {
- if ($user->hasSystemRole('admin'))
- {
+ if (strtolower(trim($confirm)) === 'yes') {
+ $totalUsers = User::query()->count();
+ $users = User::query()->whereNull('system_name')->with('roles')->get();
+ foreach ($users as $user) {
+ if ($user->hasSystemRole('admin')) {