@@ -42,14 +42,14 @@ |
||
42 | 42 | $this->info(' |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ->when($email !== '', fn ($q) => $q->where('email', 'like', "%$email%")) |
32 | 32 | ->when($host !== '', fn ($q) => $q->where('host', 'like', "%$host%")) |
33 | 33 | // Created date filters |
34 | - ->when($createdFrom !== '' || $createdTo !== '', function ($q) use ($createdFrom, $createdTo) { |
|
34 | + ->when($createdFrom !== '' || $createdTo !== '', function($q) use ($createdFrom, $createdTo) { |
|
35 | 35 | try { |
36 | 36 | if ($createdFrom !== '' && $createdTo !== '') { |
37 | 37 | $from = Carbon::createFromFormat('Y-m-d', $createdFrom)->startOfDay(); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | }) |
51 | 51 | // Deleted date filters |
52 | - ->when($deletedFrom !== '' || $deletedTo !== '', function ($q) use ($deletedFrom, $deletedTo) { |
|
52 | + ->when($deletedFrom !== '' || $deletedTo !== '', function($q) use ($deletedFrom, $deletedTo) { |
|
53 | 53 | try { |
54 | 54 | if ($deletedFrom !== '' && $deletedTo !== '') { |
55 | 55 | $from = Carbon::createFromFormat('Y-m-d', $deletedFrom)->startOfDay(); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $action = $request->input('action'); |
110 | 110 | $userIds = $request->input('user_ids', []); |
111 | 111 | |
112 | - if (! in_array($action, ['restore', 'delete'], true) || empty($userIds) || ! is_array($userIds)) { |
|
112 | + if (!in_array($action, ['restore', 'delete'], true) || empty($userIds) || !is_array($userIds)) { |
|
113 | 113 | return redirect()->route('admin.deleted.users.index')->with('error', 'Invalid bulk action request.'); |
114 | 114 | } |
115 | 115 |
@@ -31,17 +31,17 @@ |
||
31 | 31 | $purgeDays = (int) config('nntmux.purge_inactive_users_days'); |
32 | 32 | $threshold = now()->subDays($purgeDays); |
33 | 33 | |
34 | - User::query()->where('roles_id', 1)->where(function ($q) use ($threshold) { |
|
35 | - $q->where(function ($qq) use ($threshold) { |
|
34 | + User::query()->where('roles_id', 1)->where(function($q) use ($threshold) { |
|
35 | + $q->where(function($qq) use ($threshold) { |
|
36 | 36 | $qq->whereNotNull('lastlogin')->where('lastlogin', '<', $threshold); |
37 | - })->orWhere(function ($qq) use ($threshold) { |
|
37 | + })->orWhere(function($qq) use ($threshold) { |
|
38 | 38 | // Only treat null lastlogin as inactive if the account is older than threshold |
39 | 39 | $qq->whereNull('lastlogin')->where('created_at', '<', $threshold); |
40 | 40 | }); |
41 | - })->where(function ($q) use ($threshold) { |
|
42 | - $q->where(function ($qq) use ($threshold) { |
|
41 | + })->where(function($q) use ($threshold) { |
|
42 | + $q->where(function($qq) use ($threshold) { |
|
43 | 43 | $qq->whereNotNull('apiaccess')->where('apiaccess', '<', $threshold); |
44 | - })->orWhere(function ($qq) use ($threshold) { |
|
44 | + })->orWhere(function($qq) use ($threshold) { |
|
45 | 45 | $qq->whereNull('apiaccess')->where('created_at', '<', $threshold); |
46 | 46 | }); |
47 | 47 | }); |