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

{{ $laptop->asset_tag }}

{{ $laptop->brand }} {{ $laptop->model }}

Basic Information

{{ $laptop->asset_tag }}

{{ $laptop->barcode }}

{{ $laptop->brand }}

{{ $laptop->model }}

{{ $laptop->serial_number }}

{{ ucfirst($laptop->status) }}

{{ $laptop->class->name }}

@if($laptop->purchase_date)

{{ $laptop->purchase_date->format('M d, Y') }}

@endif @if($laptop->purchase_price)

${{ number_format($laptop->purchase_price, 2) }}

@endif
@if($laptop->notes)

{{ $laptop->notes }}

@endif
@if($laptop->currentAssignment)

Current Assignment

{{ $laptop->currentAssignment->student->full_name }}

{{ $laptop->currentAssignment->student->student_id }}

{{ $laptop->currentAssignment->checked_out_at->format('M d, Y H:i') }}

{{ $laptop->currentAssignment->checked_out_at->diffForHumans() }}

{{ $laptop->currentAssignment->checkedOutBy->name }}

@else

Available for Checkout

This laptop is currently available and can be checked out to a student.

Check Out Laptop
@endif

Transaction History

@if($laptop->transactions->count() > 0)
@foreach($laptop->transactions->take(10) as $transaction)
{{ $transaction->type === 'check_out' ? 'Checked Out' : 'Checked In' }}

{{ $transaction->student->full_name }}

{{ $transaction->transaction_time->format('M d, Y H:i') }}

by {{ $transaction->user->name }}
@endforeach
@if($laptop->transactions->count() > 10) @endif @else

No transactions recorded yet.

@endif

QR Code

QR Code

{{ $laptop->barcode }}

Barcode

Barcode

{{ $laptop->barcode }}

Quick Stats

Total Checkouts: {{ $laptop->transactions()->where('type', 'check_out')->count() }}
Last Activity: @if($laptop->transactions->count() > 0) {{ $laptop->transactions->first()->transaction_time->diffForHumans() }} @else Never @endif
Days in Service: {{ $laptop->created_at->diffInDays() }}
@endsection