@extends('layouts.layoutMaster')
@section('title', 'Route Detail')
@php
$breadcrumbs = [
['url' => route('dashboard'), 'label' => 'Dashboard'],
['url' => route('route.index'), 'label' => 'Routes'],
[
'url' => route('route.show', ['route' => $model->id]),
'label' => ($model->origin->name ?? '') . ' - ' . ($model->destination->name ?? ''),
],
];
@endphp
@section('content')
Route Information
| Origin Location |
{{ $model->origin->name ?? '-' }} |
| Destination Location |
{{ $model->destination->name ?? '-' }} |
| Distance |
{{ \App\Helpers\Helpers::formatNumber($model->distance, 2) }} km |
| Duration |
{{ \App\Helpers\Helpers::formatNumber($model->duration) }} hours |
| Toll Road |
@php
$tollClass = match ($model->toll) {
'full' => 'bg-success',
'half' => 'bg-warning',
'non' => 'bg-secondary',
default => 'bg-secondary',
};
$tollLabel = match ($model->toll) {
'full' => 'Full',
'half' => 'Half',
'non' => 'Non',
default => $model->toll,
};
@endphp
{{ $tollLabel }}
|
Driver Allowances
| Pocket Money 1 |
{{ \App\Helpers\Helpers::formatCurrency($model->pocket_money_1, 2) }} |
| Pocket Money 2 |
{{ $model->pocket_money_2 ? \App\Helpers\Helpers::formatCurrency($model->pocket_money_2, 2) : '-' }}
|
| Pocket Money 3 |
{{ $model->pocket_money_3 ? \App\Helpers\Helpers::formatCurrency($model->pocket_money_3, 2) : '-' }}
|
| Bonus |
{{ $model->bonus ? \App\Helpers\Helpers::formatCurrency($model->bonus, 2) : '-' }} |
| Total Allowance |
{{ \App\Helpers\Helpers::formatCurrency(
($model->pocket_money_1 ?? 0) +
($model->pocket_money_2 ?? 0) +
($model->pocket_money_3 ?? 0) +
($model->bonus ?? 0),
2
) }}
|
Created: {{ $model->created_at?->format('d/m/Y H:i') ?? '-' }}
@if ($model->createdBy)
by {{ $model->createdBy->name }}
@endif
Last Updated: {{ $model->updated_at?->format('d/m/Y H:i') ?? '-' }}
@if ($model->updatedBy)
by {{ $model->updatedBy->name }}
@endif
@endsection