refactor: reduce temporary variables passed to views

This commit is contained in:
Roardom
2023-06-19 21:17:10 +00:00
parent 1fa4a3e506
commit d2e36c368e
70 changed files with 1179 additions and 1321 deletions
@@ -133,16 +133,17 @@ class NotificationSettingController extends Controller
{
abort_unless($request->user()->id == $user->id, 403);
$groups = Group::query()
->where('is_modo', '=', '0')
->where('is_admin', '=', '0')
->where('id', '!=', UserGroups::VALIDATING)
->where('id', '!=', UserGroups::PRUNED)
->where('id', '!=', UserGroups::BANNED)
->where('id', '!=', UserGroups::DISABLED)
->latest('level')
->get();
return view('user.notification_setting.edit', ['user' => $user, 'groups' => $groups]);
return view('user.notification_setting.edit', [
'user' => $user,
'groups' => Group::query()
->where('is_modo', '=', '0')
->where('is_admin', '=', '0')
->where('id', '!=', UserGroups::VALIDATING)
->where('id', '!=', UserGroups::PRUNED)
->where('id', '!=', UserGroups::BANNED)
->where('id', '!=', UserGroups::DISABLED)
->latest('level')
->get(),
]);
}
}