@csrf @if ($method === 'PUT') @method('PUT') @endif @if ($errors->has('name'))

{{ $errors->first('name') }}

@endif @if ($errors->has('stops'))

{{ $errors->first('stops') }}

@endif
@php $stopRows = old('stops'); if ($stopRows === null) { $stopRows = $row ? $row->stops->map(fn ($s) => ['name' => $s->name, 'one_way' => $s->one_way, 'two_way' => $s->two_way])->all() : [['name' => '', 'one_way' => 0, 'two_way' => 0]]; } if ($stopRows === [] || $stopRows === null) { $stopRows = [['name' => '', 'one_way' => 0, 'two_way' => 0]]; } @endphp
Stops
@foreach ($stopRows as $i => $stop)
@endforeach
StopOne-Way KESTwo-Way KES
@if ($row) @endif
{{-- Emitted once (@once). Both handlers below are delegated from the document, so every form works even though later forms are parsed after this script runs. --}} @once @endonce