@extends('layouts.admin') @section('title', 'Create & Manage Bags') @section('content')

Bagging Station

Create new bags and view recent ones.

@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif
{{-- Current/Open Bag Section --}}

Current Bag

@if(!empty($currentBag))
Bag #: {{ $currentBag->bag_number }}
Status: {{ ucfirst($currentBag->status) }}
@if($currentBag->rider)
Rider: {{ $currentBag->rider->name }}
@endif
@csrf
@if($currentBag->items->count() > 0)

Scanned Parcels

@foreach($currentBag->items as $item) @endforeach
Tracking ID Actions
{{ $item->parcel->tracking_id }}
@csrf
@endif @if($currentBag->status === 'open')
@csrf
@endif @else
@csrf
@endif
{{-- Recent bags Section --}}

Recent Bags

@forelse($bags as $bag) @empty @endforelse
Bag Number Destination Parcels Created At Actions
{{ $bag->bag_number }} {{ $bag->items_count ?? $bag->items->count() }} {{ $bag->created_at->format('d M, Y H:i') }} Print Manifest
No bags created yet.
@endsection