index($request->user()); $films = array_filter($catalog['materials'], fn (array $card): bool => $card['type'] === 'film'); return view('member.dashboard', [ 'programs' => array_slice($catalog['programs'], 0, 4), 'counts' => [ 'programm' => count($catalog['programs']), 'modul' => count($catalog['modules']), 'film' => count($films), 'material' => count($catalog['materials']) - count($films), ], 'licenseCount' => app(MemberLicenses::class)->overview($request->user())->where('active', true)->count(), ]); } }