@extends('selfcheck.layouts.app')
@section('title', 'Trainset')
@section('page-title', 'Master Data — Trainset')
@section('content')
@php $emptyForm = ['project_id' => '', 'name' => '', 'description' => '']; @endphp
| No |
Trainset |
Proyek |
Jumlah Car |
Aksi |
@forelse ($trainsets as $i => $trainset)
| {{ $trainsets->firstItem() + $i }} |
{{ $trainset->name }}
@if ($trainset->description)
{{ $trainset->description }}
@endif
|
{{ $trainset->project->name ?? '—' }} |
{{ $trainset->cars_count }} |
|
@empty
| Belum ada trainset. |
@endforelse
@if ($trainsets->hasPages())
{{ $trainsets->links() }}
@endif
@include('selfcheck.master.partials.modal', [
'title' => 'Trainset',
'storeRoute' => 'selfcheck.master.trainsets.store',
'updateUrlBase' => url('selfcheck/master/trainsets'),
'fields' => [
['name' => 'project_id', 'label' => 'Proyek', 'type' => 'select', 'required' => true,
'options' => $projects->map(fn ($p) => ['value' => $p->id, 'label' => $p->name])->all()],
['name' => 'name', 'label' => 'Nama Trainset', 'type' => 'text', 'required' => true, 'placeholder' => 'Contoh: TS-01'],
['name' => 'description', 'label' => 'Deskripsi', 'type' => 'textarea'],
],
])
@endsection