@extends('layouts.app') @section('title', 'Route Details') @section('content')
← Back to Routes

Route Details

Airline

{{ $route->airline->name ?? '-' }}

Route Type

@switch($route->route_type->value) @case('oneway_inbound') Oneway - Inbound @break @case('oneway_outbound') Oneway - Outbound @break @case('round') Round @break @case('multi_city') Multi City @break @default {{ $route->route_type->value }} @endswitch

Flight Type

{{ ucfirst($route->flight_type->value) }}

Route

@if($route->route_type->value === 'multi_city') @if($route->multiSegments->count() > 0) @foreach($route->multiSegments as $segment) {{ $segment->fromCity->code ?? '-' }}-{{ $segment->toCity->code ?? '-' }} ({{ $segment->segment_direction->value }}) @endforeach @else - @endif @else {{ $route->fromCity->code ?? '-' }}-{{ $route->toCity->code ?? '-' }} @if($route->route_type->value === 'round') -{{ $route->returnCity->code ?? '-' }} @endif @endif

@if($route->flight_type->value === 'transit' && $route->transits->count() > 0)
Transit Info @foreach($route->transits as $transit) @php $hours = floor($transit->transit_time / 60); $minutes = $transit->transit_time % 60; @endphp

{{ $transit->transitCity->code ?? '-' }} - {{ str_pad($hours, 2, '0', STR_PAD_LEFT) }}:{{ str_pad($minutes, 2, '0', STR_PAD_LEFT) }}

@endforeach
@endif
Created At

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

Updated At

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

Edit
@csrf @method('DELETE')
@endsection