update: internal controller

This commit is contained in:
HDVinnie
2024-07-08 19:46:46 -04:00
committed by GitHub
parent 42407e085a
commit bcb2cbcc35
@@ -33,13 +33,11 @@ class InternalController extends Controller
*/
public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
$internalGroup = cache()->rememberForever('internal_group', fn () => Group::where('is_internal', '=', true)->pluck('id'));
return view('Staff.internals.index', [
'internalGroups' => Internal::orderBy('name')->get(),
'internalUsers' => User::with(['group', 'internals'])
->withCount('torrents as total_uploads')
->where('group_id', '=', $internalGroup)
->whereIn('group_id', Group::select('id')->where('is_internal', '=', true))
->orWhereHas('internals')
// Count recent uploads for current user
->withCount(['torrents as recent_uploads' => fn ($query) => $query