@php $rowsPerPage = 18; // Number of rows that fit nicely on a page $studentChunks = collect($students)->chunk($rowsPerPage); @endphp @foreach($studentChunks as $pageIndex => $pageStudents) @if($pageIndex > 0)
@endif
Student Credentials
Name Group Username Password
@foreach($pageStudents as $student) @php $nameParts = preg_split('/\s+/', trim($student['name'])); $firstName = $nameParts[0] ?? ''; $formattedName = $firstName; if (count($nameParts) > 1) { $lastName = $nameParts[count($nameParts) - 1] ?? ''; if (!empty($lastName)) { $formattedName .= ' ' . strtoupper(substr($lastName, 0, 1)) . '.'; } } @endphp @endforeach @php $emptyRows = $rowsPerPage - count($pageStudents); @endphp @for($i = 0; $i < $emptyRows; $i++) @endfor
{{ $formattedName }} {{ $student['group'] }} {{ $student['username'] }} {{ $student['password'] }}
       
Note: If you have a global password set, it has replaced the unique password for all students above—unless this setting is disabled within a student's account profile.
@endforeach