@include('layouts.users-navbar') @if (session('warning'))
{{ session('warning') }}
@endif

Find din næste tur

@php $today = date('Y-m-d'); @endphp
@foreach ($trips as $trip)
@php $startDateTime = new DateTime($trip->departure_time); $endDateTime = new DateTime($trip->arrival_time); @endphp

{{ $startDateTime->format('H:i') }} {{ $trip->startLocation->name }}

{{ $endDateTime->format('H:i') }}{{ $trip->endLocation->name }}

@if (strlen($trip->description) > 20) {{ substr($trip->description, 0, 20) }} ... Read More @else {{ $trip->description ? $trip->description : 'No description' }} @endif

@php $startDateTime = new DateTime($trip->departure_time); $endDateTime = new DateTime($trip->arrival_time); $timeInterval = $startDateTime->diff($endDateTime); $hours = $timeInterval->h; $minutes = $timeInterval->i; $hours += $timeInterval->days * 24; @endphp
Bus: {{ $trip->bus->type }}
{{ $hours }} timer, {{ $minutes }} minutter
Pris:{{ $trip->price }}DKK
Kapacitet: {{ $trip->bus_capacity }}
Ledige pladser: {{ $trip->available_spots }}
@if ($trip->available_spots > 0) Book Nu @else Ingen ledige pladser @endif
@endforeach @if ($trips->lastPage() > 1)
{{ $trips->links() }}
@endif
@include('layouts.footer')