{{-- resources/views/classes/show.blade.php --}} @extends('layouts.base') @section('content')

{{ $class->name }}

@if($class->grade_level)

Grade {{ $class->grade_level }} {{ $class->section ? '- ' . $class->section : '' }}

@endif @if($class->description)

{{ $class->description }}

@endif
{{ $class->students()->count() }}
Students
{{ $class->laptops()->where('status', 'available')->count() }}
Available Laptops
{{ $class->laptops()->where('status', 'checked_out')->count() }}
Checked Out
{{ $class->laptops()->whereIn('status', ['maintenance', 'damaged'])->count() }}
Issues

Students

@forelse($class->students as $student) @empty @endforelse
Student ID Name Email Current Laptop Status
{{ $student->student_id }} {{ $student->full_name }} {{ $student->email ?? '-' }} @if($student->currentAssignment) {{ $student->currentAssignment->laptop->asset_tag }} @else - @endif {{ $student->is_active ? 'Active' : 'Inactive' }}
No students in this class.

Laptops

@forelse($class->laptops as $laptop) @empty @endforelse
Asset Tag Brand/Model Status Current Student Since
{{ $laptop->asset_tag }} {{ $laptop->brand }} {{ $laptop->model }} {{ ucfirst($laptop->status) }} @if($laptop->currentAssignment) {{ $laptop->currentAssignment->student->full_name }} @else - @endif @if($laptop->currentAssignment) {{ $laptop->currentAssignment->checked_out_at->format('M d, Y') }} @else - @endif
No laptops assigned to this class.
@endsection