Undangan/backend-baru/resources/views/admin/template/index.blade.php
2025-10-02 14:20:41 +07:00

40 lines
1.3 KiB
PHP

@extends('layouts.app')
@section('title', 'Manajemen Template')
@section('content')
<div class="container mt-4">
<h2>Daftar Template</h2>
<a href="{{ route('admin.templates.create') }}" class="btn btn-primary mb-3">+ Tambah Template</a>
<table class="table table-bordered">
<thead>
<tr>
<th>Nama</th>
<th>Kategori</th>
<th>Paket</th>
<th>Harga</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@foreach($templates as $t)
<tr>
<td>{{ $t->nama_template }}</td>
<td>{{ $t->kategori->nama ?? '-' }}</td>
<td>{{ ucfirst($t->paket) }}</td>
<td>Rp {{ number_format($t->harga,0,',','.') }}</td>
<td>
<a href="{{ route('admin.templates.edit',$t->id) }}" class="btn btn-sm btn-warning">Edit</a>
<form action="{{ route('admin.templates.destroy',$t->id) }}" method="POST" class="d-inline">
@csrf @method('DELETE')
<button class="btn btn-sm btn-danger" onclick="return confirm('Yakin hapus?')">Hapus</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection