Merge branch 'main' of https://git.abbauf.com/Magang-2025/Undangan
This commit is contained in:
commit
2b945a5243
@ -41,25 +41,6 @@ class ReviewController extends Controller
|
|||||||
return response()->json($review, 200);
|
return response()->json($review, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update ulasan
|
|
||||||
public function update(Request $request, $id)
|
|
||||||
{
|
|
||||||
$review = Review::findOrFail($id);
|
|
||||||
|
|
||||||
$validated = $request->validate([
|
|
||||||
'rating' => 'integer|min:1|max:5',
|
|
||||||
'message' => 'string',
|
|
||||||
'name' => 'string|max:100',
|
|
||||||
'city' => 'string|max:100',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$review->update($validated);
|
|
||||||
|
|
||||||
return response()->json([
|
|
||||||
'message' => 'Ulasan berhasil diperbarui',
|
|
||||||
'data' => $review
|
|
||||||
], 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hapus ulasan
|
// Hapus ulasan
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
|
@ -24,11 +24,11 @@ class KategoriController extends Controller
|
|||||||
// Simpan kategori baru
|
// Simpan kategori baru
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'nama' => 'required|string|max:255',
|
'nama' => 'required|string|max:255',
|
||||||
'deskripsi' => 'nullable|string',
|
'deskripsi' => 'nullable|string',
|
||||||
'foto' => 'nullable|image|mimes:jpg,jpeg,png|max:2048'
|
'foto' => 'nullable|image|mimes:jpeg,png,jpg,gif|max:5120'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = $request->all();
|
$data = $request->all();
|
||||||
if ($request->hasFile('foto')) {
|
if ($request->hasFile('foto')) {
|
||||||
@ -48,10 +48,10 @@ class KategoriController extends Controller
|
|||||||
$request->validate([
|
$request->validate([
|
||||||
'nama' => 'required|string|max:255',
|
'nama' => 'required|string|max:255',
|
||||||
'deskripsi' => 'nullable|string',
|
'deskripsi' => 'nullable|string',
|
||||||
'foto' => 'nullable|image|mimes:jpg,jpeg,png|max:2048'
|
'foto' => 'nullable|image|mimes:jpg,jpeg,png|max:5120'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = $request->all();
|
$data = $request->all();
|
||||||
if ($request->hasFile('foto')) {
|
if ($request->hasFile('foto')) {
|
||||||
if ($kategori->foto) {
|
if ($kategori->foto) {
|
||||||
Storage::disk('public')->delete($kategori->foto);
|
Storage::disk('public')->delete($kategori->foto);
|
||||||
|
@ -3,111 +3,52 @@
|
|||||||
@section('title', 'Halaman Dasbor')
|
@section('title', 'Halaman Dasbor')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container">
|
<div class="container mx-auto py-4">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
<div class="flex justify-between items-center mb-4">
|
||||||
<h3 class="fw-bold">Halaman Dasbor</h3>
|
<h3 class="text-xl font-bold">Halaman Dasbor</h3>
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
<div class="d-flex align-items-center gap-3">
|
<div class="bg-blue-100 text-blue-600 px-3 py-2 rounded-lg flex items-center gap-2 text-sm">
|
||||||
<div class="date-box bg-primary bg-opacity-10 text-primary px-3 py-2 rounded">
|
|
||||||
<i class="bi bi-clock-history"></i>
|
<i class="bi bi-clock-history"></i>
|
||||||
{{ \Carbon\Carbon::now()->translatedFormat('l, d F Y') }}
|
{{ \Carbon\Carbon::now()->translatedFormat('l, d F Y') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Logout -->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Cards -->
|
<!-- Cards -->
|
||||||
<div class="row g-4">
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
<div class="col-md-4">
|
<div class="bg-white rounded-lg shadow-md p-4 flex justify-between items-center hover:shadow-lg transition-transform duration-300 transform hover:-translate-y-2">
|
||||||
<div class="dashboard-card">
|
<div>
|
||||||
<div>
|
<h5 class="text-gray-500 text-sm">Kategori</h5>
|
||||||
<h5>Kategori</h5>
|
<h3 class="font-bold text-xl">10</h3>
|
||||||
<h3>10</h3>
|
</div>
|
||||||
</div>
|
<div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-lg flex items-center justify-center text-xl">
|
||||||
<i class="bi bi-diagram-3 dashboard-icon"></i>
|
<i class="bi bi-diagram-3"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="bg-white rounded-lg shadow-md p-4 flex justify-between items-center hover:shadow-lg transition-transform duration-300 transform hover:-translate-y-2">
|
||||||
<div class="dashboard-card">
|
<div>
|
||||||
<div>
|
<h5 class="text-gray-500 text-sm">Templat</h5>
|
||||||
<h5>Templat</h5>
|
<h3 class="font-bold text-xl">20</h3>
|
||||||
<h3>20</h3>
|
</div>
|
||||||
</div>
|
<div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-lg flex items-center justify-center text-xl">
|
||||||
<i class="bi bi-card-list dashboard-icon"></i>
|
<i class="bi bi-card-list"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="bg-white rounded-lg shadow-md p-4 flex justify-between items-center hover:shadow-lg transition-transform duration-300 transform hover:-translate-y-2">
|
||||||
<div class="dashboard-card">
|
<div>
|
||||||
<div>
|
<h5 class="text-gray-500 text-sm">Pelanggan</h5>
|
||||||
<h5>Pelanggan</h5>
|
<h3 class="font-bold text-xl">24</h3>
|
||||||
<h3>24</h3>
|
</div>
|
||||||
</div>
|
<div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-lg flex items-center justify-center text-xl">
|
||||||
<i class="bi bi-person dashboard-icon"></i>
|
<i class="bi bi-person"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Pesan login -->
|
<!-- Pesan login -->
|
||||||
<div class="alert alert-success mt-4">
|
<div class="bg-green-100 text-green-700 p-4 rounded-lg mt-4">
|
||||||
Berhasil login sebagai <strong>{{ auth('admin')->user()->name }}</strong>
|
Berhasil login sebagai <strong>{{ auth('admin')->user()->name }}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<style>
|
@endsection
|
||||||
/* STYLE DASHBOARD CARD */
|
|
||||||
.dashboard-card {
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
|
||||||
padding: 20px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
background: #fff;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-card:hover {
|
|
||||||
transform: translateY(-3px);
|
|
||||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-card h5 {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #6c757d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-card h3 {
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-icon {
|
|
||||||
width: 50px; /* ukuran kotak tetap */
|
|
||||||
height: 50px; /* tinggi sama dengan lebar */
|
|
||||||
display: flex; /* agar icon center */
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 24px; /* ukuran ikon */
|
|
||||||
color: #0d6efd; /* warna ikon */
|
|
||||||
background: #eef4ff; /* background biru muda */
|
|
||||||
border-radius: 12px; /* sudut sedikit rounded */
|
|
||||||
flex-shrink: 0; /* biar kotak gak mengecil */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Kotak tanggal di header dashboard */
|
|
||||||
.date-box {
|
|
||||||
background: #eef4ff;
|
|
||||||
color: #0d6efd;
|
|
||||||
padding: 6px 12px;
|
|
||||||
border-radius: 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@endsection
|
|
@ -3,55 +3,57 @@
|
|||||||
@section('title', 'Manajemen Fitur')
|
@section('title', 'Manajemen Fitur')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container">
|
<div class="container mx-auto py-4">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
<div class="flex justify-between items-center mb-4">
|
||||||
<h3 class="fw-bold">Manajemen Fitur</h3>
|
<h3 class="text-xl font-bold">Manajemen Fitur</h3>
|
||||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalTambah">
|
<button class="bg-blue-600 text-white px-3 py-1 rounded" data-bs-toggle="modal" data-bs-target="#modalTambah">
|
||||||
<i class="bi bi-plus-lg"></i> Tambah Fitur
|
<i class="bi bi-plus-lg mr-1"></i> Tambah Fitur
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Tabel Fitur -->
|
<!-- Tabel Fitur -->
|
||||||
<div class="card shadow-sm border-0">
|
<div class="bg-white rounded-lg shadow-sm">
|
||||||
<div class="card-body">
|
<div class="p-4">
|
||||||
<table class="table table-hover align-middle">
|
<table class="w-full table-fixed border border-gray-300 text-left">
|
||||||
<thead>
|
<thead class="bg-gray-100">
|
||||||
<tr>
|
<tr>
|
||||||
<th width="50">No</th>
|
<th class="w-[10%] p-2 border border-gray-300">Nomor</th>
|
||||||
<th>Nama Fitur</th>
|
<th class="w-[70%] p-2 border border-gray-300">Fitur</th>
|
||||||
<th width="180">Aksi</th>
|
<th class="w-[20%] p-2 border border-gray-300 text-center">Aksi</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@forelse ($fiturs as $key => $fitur)
|
@forelse ($fiturs as $key => $fitur)
|
||||||
<tr>
|
<tr class="hover:bg-gray-50">
|
||||||
<td>{{ $key + 1 }}</td>
|
<td class="p-2 border border-gray-300">{{ $key + 1 }}</td>
|
||||||
<td>{{ $fitur->nama_fitur }}</td>
|
<td class="p-2 border border-gray-300 truncate whitespace-nowrap">{{ $fitur->nama_fitur }}</td>
|
||||||
<td>
|
<td class="p-2 border border-gray-300 text-center">
|
||||||
<button class="btn btn-warning btn-sm" data-bs-toggle="modal"
|
<div class="flex justify-center space-x-2">
|
||||||
data-bs-target="#modalEdit{{ $fitur->id }}">
|
<button class="text-blue-600 flex items-center pr-4" data-bs-toggle="modal" data-bs-target="#modalEdit{{ $fitur->id }}">
|
||||||
<i class="bi bi-pencil"></i>
|
<i class="bi bi-pencil mr-1"></i> Ubah
|
||||||
</button>
|
</button>
|
||||||
<form action="{{ route('admin.fitur.destroy', $fitur->id) }}"
|
<form action="{{ route('admin.fitur.destroy', $fitur->id) }}"
|
||||||
method="POST"
|
method="POST"
|
||||||
class="d-inline"
|
class="inline"
|
||||||
onsubmit="return confirm('Yakin mau hapus fitur ini?')">
|
onsubmit="return confirm('Yakin mau hapus fitur ini?')">
|
||||||
@csrf
|
@csrf
|
||||||
@method('DELETE')
|
@method('DELETE')
|
||||||
<button class="btn btn-danger btn-sm">
|
<button class="text-red-600 flex items-center">
|
||||||
<i class="bi bi-trash"></i>
|
<i class="bi bi-trash mr-1"></i> Hapus
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</td>
|
||||||
@empty
|
</tr>
|
||||||
<tr>
|
@empty
|
||||||
<td colspan="3" class="text-center text-muted">Belum ada fitur</td>
|
<tr>
|
||||||
</tr>
|
<td colspan="3" class="p-2 text-center text-gray-500">Belum ada fitur</td>
|
||||||
@endforelse
|
</tr>
|
||||||
</tbody>
|
@endforelse
|
||||||
</table>
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -62,18 +64,18 @@
|
|||||||
<form action="{{ route('admin.fitur.store') }}" method="POST" class="modal-content">
|
<form action="{{ route('admin.fitur.store') }}" method="POST" class="modal-content">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title">Tambah Fitur</h5>
|
<h5 class="modal-title text-lg font-medium">Tambah Fitur</h5>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="mb-3">
|
<div class="mb-4">
|
||||||
<label>Nama Fitur</label>
|
<label class="block text-sm font-medium">Nama Fitur</label>
|
||||||
<input type="text" name="nama_fitur" class="form-control" required>
|
<input type="text" name="nama_fitur" class="w-full p-2 border rounded" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
<button class="bg-gray-300 text-black px-3 py-1 rounded" data-bs-dismiss="modal">Batal</button>
|
||||||
<button class="btn btn-primary">Simpan</button>
|
<button class="bg-blue-600 text-white px-3 py-1 rounded">Simpan</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -87,21 +89,21 @@
|
|||||||
@csrf
|
@csrf
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title">Edit Fitur</h5>
|
<h5 class="modal-title text-lg font-medium">Edit Fitur</h5>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="mb-3">
|
<div class="mb-4">
|
||||||
<label>Nama Fitur</label>
|
<label class="block text-sm font-medium">Nama Fitur</label>
|
||||||
<input type="text" name="nama_fitur" value="{{ $fitur->nama_fitur }}" class="form-control" required>
|
<input type="text" name="nama_fitur" value="{{ $fitur->nama_fitur }}" class="w-full p-2 border rounded" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
<button class="bg-gray-300 text-black px-3 py-1 rounded" data-bs-dismiss="modal">Batal</button>
|
||||||
<button class="btn btn-primary">Simpan Perubahan</button>
|
<button class="bg-blue-600 text-white px-3 py-1 rounded">Simpan Perubahan</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endsection
|
@endsection
|
@ -3,142 +3,182 @@
|
|||||||
@section('title', 'Manajemen Kategori')
|
@section('title', 'Manajemen Kategori')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container-fluid py-4">
|
<div class="container mx-auto py-4">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
<div class="flex justify-between items-center mb-4">
|
||||||
<h3 class="fw-bold mb-0">Manajemen Kategori</h3>
|
<h3 class="text-xl font-bold">Manajemen Kategori</h3>
|
||||||
<button class="btn btn-primary px-3" data-bs-toggle="modal" data-bs-target="#modalTambah">
|
<button class="bg-blue-600 text-white px-3 py-2.5 rounded" data-bs-toggle="modal" data-bs-target="#modalTambah">
|
||||||
<i class="bi bi-plus-lg me-1"></i> Nambah Kategori
|
<i class="bi bi-plus-lg mr-1"></i> Nambah Kategori
|
||||||
</button>
|
</button>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Tabel Kategori -->
|
|
||||||
<div class="card border-0 shadow-sm rounded-3">
|
|
||||||
<div class="card-body">
|
|
||||||
<table class="table table-borderless align-middle text-nowrap">
|
|
||||||
<thead class="table-light">
|
|
||||||
<tr>
|
|
||||||
<th width="50">Nomor</th>
|
|
||||||
<th>Nama Kategori</th>
|
|
||||||
<th>Keterangan</th>
|
|
||||||
<th>Foto</th>
|
|
||||||
<th width="150" class="text-center">Aksi</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@forelse ($kategori as $key => $item)
|
|
||||||
<tr class="align-middle">
|
|
||||||
<td>{{ $key + 1 }}</td>
|
|
||||||
<td>{{ $item->nama }}</td>
|
|
||||||
<td class="text-truncate" style="max-width:300px;">
|
|
||||||
{{ $item->deskripsi ?? '-' }}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if($item->foto)
|
|
||||||
<img src="{{ asset('storage/'.$item->foto) }}" alt="foto"
|
|
||||||
width="50" height="50"
|
|
||||||
class="rounded" style="object-fit:cover;">
|
|
||||||
@else
|
|
||||||
<img src="{{ asset('default-image.png') }}" alt="default"
|
|
||||||
width="50" height="50"
|
|
||||||
class="rounded" style="object-fit:cover;">
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<button class="btn btn-link text-primary p-0 me-2"
|
|
||||||
data-bs-toggle="modal"
|
|
||||||
data-bs-target="#modalEdit{{ $item->id }}">
|
|
||||||
<i class="bi bi-pencil me-1"></i> Ubah
|
|
||||||
</button>
|
|
||||||
<form action="{{ route('admin.kategori.destroy', $item->id) }}"
|
|
||||||
method="POST"
|
|
||||||
class="d-inline"
|
|
||||||
onsubmit="return confirm('Yakin mau hapus kategori ini?')">
|
|
||||||
@csrf
|
|
||||||
@method('DELETE')
|
|
||||||
<button class="btn btn-link text-danger p-0">
|
|
||||||
<i class="bi bi-trash me-1"></i> Hapus
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@empty
|
|
||||||
<tr>
|
|
||||||
<td colspan="5" class="text-center text-muted">Belum ada kategori</td>
|
|
||||||
</tr>
|
|
||||||
@endforelse
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Modal Tambah -->
|
<!-- Flash Message -->
|
||||||
<div class="modal fade" id="modalTambah" tabindex="-1">
|
@if (session('success'))
|
||||||
<div class="modal-dialog">
|
<div id="toast-success" class="mb-4 p-3 rounded bg-green-100 text-green-800 border border-green-300 shadow">
|
||||||
<form action="{{ route('admin.kategori.store') }}" method="POST" enctype="multipart/form-data" class="modal-content">
|
{{ session('success') }}
|
||||||
@csrf
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Tambah Kategori</h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<script>
|
||||||
<div class="mb-3">
|
setTimeout(() => {
|
||||||
<label class="form-label">Nama</label>
|
document.getElementById('toast-success')?.remove();
|
||||||
<input type="text" name="nama" class="form-control" required>
|
}, 3000);
|
||||||
</div>
|
</script>
|
||||||
<div class="mb-3">
|
@endif
|
||||||
<label class="form-label">Deskripsi</label>
|
|
||||||
<textarea name="deskripsi" class="form-control" rows="3"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label class="form-label">Foto</label>
|
|
||||||
<input type="file" name="foto" class="form-control">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
|
||||||
<button class="btn btn-primary">Simpan</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Modal Edit -->
|
@if ($errors->any())
|
||||||
@foreach ($kategori as $item)
|
<div id="toast-error" class="mb-4 p-3 rounded bg-red-100 text-red-800 border border-red-300 shadow">
|
||||||
<div class="modal fade" id="modalEdit{{ $item->id }}" tabindex="-1">
|
<ul class="list-disc ml-5">
|
||||||
<div class="modal-dialog">
|
@foreach ($errors->all() as $error)
|
||||||
<form action="{{ route('admin.kategori.update', $item->id) }}" method="POST" enctype="multipart/form-data" class="modal-content">
|
<li>{{ $error }}</li>
|
||||||
@csrf
|
@endforeach
|
||||||
@method('PUT')
|
</ul>
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Edit Kategori</h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<script>
|
||||||
<div class="mb-3">
|
setTimeout(() => {
|
||||||
<label class="form-label">Nama</label>
|
document.getElementById('toast-error')?.remove();
|
||||||
<input type="text" name="nama" value="{{ $item->nama }}" class="form-control" required>
|
}, 5000);
|
||||||
</div>
|
</script>
|
||||||
<div class="mb-3">
|
@endif
|
||||||
<label class="form-label">Deskripsi</label>
|
|
||||||
<textarea name="deskripsi" class="form-control" rows="3">{{ $item->deskripsi }}</textarea>
|
<!-- Tabel Kategori -->
|
||||||
</div>
|
<div class="bg-white rounded-lg shadow-sm">
|
||||||
<div class="mb-3">
|
<div class="p-4">
|
||||||
<label class="form-label">Foto</label>
|
<table class="w-full table-fixed text-left border border-gray-300 border-collapse">
|
||||||
<input type="file" name="foto" class="form-control">
|
<thead class="bg-gray-100">
|
||||||
@if($item->foto)
|
<tr>
|
||||||
<small class="text-muted">Foto saat ini:</small><br>
|
<th class="p-2 border border-gray-300 w-[50px] text-center">No</th>
|
||||||
<img src="{{ asset('storage/'.$item->foto) }}" alt="foto" width="70" class="mt-1 rounded">
|
<th class="p-2 border border-gray-300 w-[150px]">Nama Kategori</th>
|
||||||
@endif
|
<th class="p-2 border border-gray-300 w-[300px]">Keterangan</th>
|
||||||
|
<th class="p-2 border border-gray-300 w-[90px] text-center">Foto</th>
|
||||||
|
<th class="p-2 border border-gray-300 w-[110px] text-center">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@forelse ($kategori as $key => $item)
|
||||||
|
<tr>
|
||||||
|
<td class="p-2 border border-gray-300 text-center truncate">{{ $key + 1 }}</td>
|
||||||
|
<td class="p-2 border border-gray-300 truncate">{{ $item->nama }}</td>
|
||||||
|
<td class="p-2 border border-gray-300 truncate">
|
||||||
|
{{ $item->deskripsi ?? '-' }}
|
||||||
|
</td>
|
||||||
|
<td class="p-2 border border-gray-300 text-center">
|
||||||
|
<div
|
||||||
|
class="w-12 h-12 overflow-hidden rounded bg-gray-100 flex items-center justify-center mx-auto">
|
||||||
|
@if ($item->foto)
|
||||||
|
<img src="{{ asset('storage/' . $item->foto) }}" alt="foto"
|
||||||
|
class="max-w-full max-h-full object-contain">
|
||||||
|
@else
|
||||||
|
<img src="{{ asset('default-image.png') }}" alt="default"
|
||||||
|
class="max-w-full max-h-full object-contain">
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="p-2 border border-gray-300 text-center">
|
||||||
|
<div class="flex justify-center space-x-2">
|
||||||
|
<button class="text-blue-600 hover:underline flex items-center pr-4"
|
||||||
|
data-bs-toggle="modal" data-bs-target="#modalEdit{{ $item->id }}">
|
||||||
|
<i class="bi bi-pencil mr-1"></i> Ubah
|
||||||
|
</button>
|
||||||
|
<form action="{{ route('admin.kategori.destroy', $item->id) }}" method="POST"
|
||||||
|
class="inline" onsubmit="return confirm('Yakin mau hapus kategori ini?')">
|
||||||
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
<button class="text-red-600 hover:underline flex items-center">
|
||||||
|
<i class="bi bi-trash mr-1"></i> Hapus
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="p-2 text-center text-gray-500 border border-gray-300">Belum ada
|
||||||
|
kategori</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="modalTambah" tabindex="-1">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<form action="{{ route('admin.kategori.store') }}" method="POST" enctype="multipart/form-data"
|
||||||
|
class="modal-content">
|
||||||
|
@csrf
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title text-lg font-medium">Tambah Kategori</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block text-sm font-medium">Nama</label>
|
||||||
|
<input type="text" name="nama" class="w-full p-2 border rounded" required>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block text-sm font-medium">Deskripsi</label>
|
||||||
|
<textarea name="deskripsi" class="w-full p-2 border rounded" rows="3"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block text-sm font-medium">Foto</label>
|
||||||
|
<input type="file" name="foto" class="w-full p-2 border rounded" accept="image/*">
|
||||||
|
<small class="text-gray-500">Format yang didukung: JPG, PNG, GIF. Maksimal 5MB.</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button class="bg-gray-300 text-black px-3 py-1 rounded" data-bs-dismiss="modal">Batal</button>
|
||||||
|
<button class="bg-blue-600 text-white px-3 py-1 rounded">Simpan</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal Edit -->
|
||||||
|
@foreach ($kategori as $item)
|
||||||
|
<div class="modal fade" id="modalEdit{{ $item->id }}" tabindex="-1">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<form action="{{ route('admin.kategori.update', $item->id) }}" method="POST"
|
||||||
|
enctype="multipart/form-data" class="modal-content">
|
||||||
|
@csrf
|
||||||
|
@method('PUT')
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title text-lg font-medium">Edit Kategori</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block text-sm font-medium">Nama</label>
|
||||||
|
<input type="text" name="nama" value="{{ $item->nama }}"
|
||||||
|
class="w-full p-2 border rounded" required>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block text-sm font-medium">Deskripsi</label>
|
||||||
|
<textarea name="deskripsi" class="w-full p-2 border rounded" rows="3">{{ $item->deskripsi }}</textarea>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="block text-sm font-medium">Foto</label>
|
||||||
|
<input type="file" name="foto" class="w-full p-2 border rounded" accept="image/*">
|
||||||
|
<small class="text-gray-500">Format yang didukung: JPG, PNG, GIF. Maksimal 5MB.</small>
|
||||||
|
@if ($item->foto)
|
||||||
|
<div class="mt-2">
|
||||||
|
<small class="text-gray-500">Foto saat ini:</small><br>
|
||||||
|
<div
|
||||||
|
class="w-20 h-20 mt-1 overflow-hidden rounded bg-gray-100 flex items-center justify-center border">
|
||||||
|
<img src="{{ asset('storage/' . $item->foto) }}" alt="foto"
|
||||||
|
class="max-w-full max-h-full object-contain">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button class="bg-gray-300 text-black px-3 py-1 rounded"
|
||||||
|
data-bs-dismiss="modal">Batal</button>
|
||||||
|
<button class="bg-blue-600 text-white px-3 py-1 rounded">Simpan Perubahan</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
@endforeach
|
||||||
<button class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
@endsection
|
||||||
<button class="btn btn-primary">Simpan Perubahan</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endforeach
|
|
||||||
@endsection
|
|
||||||
|
@ -3,107 +3,106 @@
|
|||||||
@section('title', 'Manajemen Ulasan')
|
@section('title', 'Manajemen Ulasan')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container-fluid">
|
<div class="container mx-auto py-4">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
<!-- Header -->
|
||||||
<h3 class="fw-bold">Manajemen Ulasan</h3>
|
<div class="flex justify-between items-center mb-4">
|
||||||
|
<h3 class="text-xl font-bold">Manajemen Ulasan</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
{{-- Info kecil bahwa tambah data via Postman --}}
|
<!-- Alert sukses -->
|
||||||
|
@if (session('success'))
|
||||||
</div>
|
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4" role="alert">
|
||||||
|
{{ session('success') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
{{-- Alert sukses --}}
|
<!-- Tabel Ulasan -->
|
||||||
@if(session('success'))
|
<div class="bg-white rounded-lg shadow-sm">
|
||||||
<div class="alert alert-success">{{ session('success') }}</div>
|
<div class="p-4 overflow-x-auto">
|
||||||
@endif
|
<table class="w-full table-fixed text-left border border-gray-300 border-collapse">
|
||||||
|
<thead class="bg-gray-100">
|
||||||
{{-- Tabel Ulasan --}}
|
|
||||||
<div class="card shadow-sm border-0">
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-hover align-middle">
|
|
||||||
<thead class="table-light">
|
|
||||||
<tr>
|
<tr>
|
||||||
<th width="60">No</th>
|
<th class="p-2 border border-gray-300 w-[50px] text-center">No</th>
|
||||||
<th>Nama</th>
|
<th class="p-2 border border-gray-300 w-[150px]">Nama</th>
|
||||||
<th>Kota</th>
|
<th class="p-2 border border-gray-300 w-[120px]">Kota</th>
|
||||||
<th>Rating</th>
|
<th class="p-2 border border-gray-300 w-[120px] text-center">Rating</th>
|
||||||
<th>Pesan</th>
|
<th class="p-2 border border-gray-300 w-[350px]">Pesan</th>
|
||||||
<th width="120" class="text-center">Aksi</th>
|
<th class="p-2 border border-gray-300 w-[120px] text-center">Aksi</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@forelse ($reviews as $i => $review)
|
@forelse ($reviews as $key => $review)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $i + 1 }}</td>
|
<td class="p-2 border border-gray-300 text-center truncate">{{ $key + 1 }}</td>
|
||||||
<td>{{ $review->name }}</td>
|
<td class="p-2 border border-gray-300 truncate">{{ $review->name }}</td>
|
||||||
<td>{{ $review->city }}</td>
|
<td class="p-2 border border-gray-300 truncate">{{ $review->city }}</td>
|
||||||
<td>
|
<td class="p-2 border border-gray-300 text-center">
|
||||||
@for($s=1; $s<=5; $s++)
|
@for ($s = 1; $s <= 5; $s++)
|
||||||
<i class="bi {{ $s <= $review->rating ? 'bi-star-fill text-warning' : 'bi-star text-secondary' }}"></i>
|
<i
|
||||||
|
class="bi {{ $s <= $review->rating ? 'bi-star-fill text-yellow-500' : 'bi-star text-gray-400' }}"></i>
|
||||||
@endfor
|
@endfor
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $review->message }}</td>
|
<td class="p-2 border border-gray-300 truncate" title="{{ $review->message }}">
|
||||||
<td class="text-center">
|
{{ $review->message }}
|
||||||
<button
|
</td>
|
||||||
type="button"
|
<td class="p-2 border border-gray-300 text-center">
|
||||||
class="btn btn-sm btn-danger btn-delete"
|
<div class="flex justify-center space-x-2">
|
||||||
data-action="{{ route('admin.reviews.destroy', $review) }}"
|
<button class="text-red-600 hover:underline flex items-center btn-delete"
|
||||||
data-name="{{ $review->name }}"
|
data-action="{{ route('admin.reviews.destroy', $review->id) }}"
|
||||||
>
|
data-name="{{ $review->name }}">
|
||||||
<i class="bi bi-trash"></i> Hapus
|
<i class="bi bi-trash mr-1"></i> Hapus
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@empty
|
@empty
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6" class="text-center text-muted">Belum ada ulasan</td>
|
<td colspan="6" class="p-2 text-center text-gray-500 border border-gray-300">
|
||||||
|
Belum ada ulasan
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforelse
|
@endforelse
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- Modal Konfirmasi Hapus (satu modal untuk semua baris) --}}
|
|
||||||
<div class="modal fade" id="confirmDeleteModal" tabindex="-1" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
|
||||||
<form id="deleteForm" method="POST" class="modal-content">
|
|
||||||
@csrf
|
|
||||||
@method('DELETE')
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Hapus Ulasan</h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
Apakah Anda yakin ingin menghapus ulasan dari <strong id="deleteName">—</strong>?
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
|
||||||
<button type="submit" class="btn btn-danger">Ya, Hapus</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- Script kecil untuk set action form hapus --}}
|
<!-- Modal Konfirmasi Hapus -->
|
||||||
<script>
|
<div class="modal fade" id="confirmDeleteModal" tabindex="-1">
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
<div class="modal-dialog">
|
||||||
const modalEl = document.getElementById('confirmDeleteModal');
|
<form id="deleteForm" method="POST" class="modal-content">
|
||||||
const deleteForm = document.getElementById('deleteForm');
|
@csrf
|
||||||
const deleteName = document.getElementById('deleteName');
|
@method('DELETE')
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title text-lg font-medium">Hapus Ulasan</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
Apakah Anda yakin ingin menghapus ulasan dari <strong id="deleteName">—</strong>?
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="bg-gray-300 text-black px-3 py-1 rounded"
|
||||||
|
data-bs-dismiss="modal">Batal</button>
|
||||||
|
<button type="submit" class="bg-red-600 text-white px-3 py-1 rounded">Ya, Hapus</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
document.querySelectorAll('.btn-delete').forEach(btn => {
|
<script>
|
||||||
btn.addEventListener('click', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
deleteForm.action = btn.dataset.action;
|
const modalEl = document.getElementById('confirmDeleteModal');
|
||||||
deleteName.textContent = btn.dataset.name || 'pengguna ini';
|
const deleteForm = document.getElementById('deleteForm');
|
||||||
new bootstrap.Modal(modalEl).show();
|
const deleteName = document.getElementById('deleteName');
|
||||||
});
|
|
||||||
});
|
document.querySelectorAll('.btn-delete').forEach(btn => {
|
||||||
});
|
btn.addEventListener('click', () => {
|
||||||
</script>
|
deleteForm.action = btn.dataset.action;
|
||||||
@endsection
|
deleteName.textContent = btn.dataset.name || 'pengguna ini';
|
||||||
|
new bootstrap.Modal(modalEl).show();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
<title>@yield('title', 'Admin Panel')</title>
|
<title>@yield('title', 'Admin Panel')</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: #f1f5f9;
|
background-color: #f1f5f9;
|
||||||
@ -99,53 +100,6 @@
|
|||||||
border-left: none;
|
border-left: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BOTTOM PROFILE */
|
|
||||||
.sidebar-bottom {
|
|
||||||
padding: 15px 20px;
|
|
||||||
border-top: 1px solid #eee;
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-bottom .logout {
|
|
||||||
color: #dc3545;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-weight: 600;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-bottom .logout i {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-bottom .profile {
|
|
||||||
margin-top: 15px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-bottom .profile img {
|
|
||||||
width: 38px;
|
|
||||||
height: 38px;
|
|
||||||
border-radius: 50%;
|
|
||||||
object-fit: cover;
|
|
||||||
border: 2px solid #ddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-bottom .profile p {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-bottom .profile small {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #6c757d;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* MAIN CONTENT */
|
/* MAIN CONTENT */
|
||||||
.main-content {
|
.main-content {
|
||||||
margin-left: 250px;
|
margin-left: 250px;
|
||||||
@ -161,7 +115,7 @@
|
|||||||
<div id="sidebar" class="sidebar bg-white d-flex flex-column">
|
<div id="sidebar" class="sidebar bg-white d-flex flex-column">
|
||||||
|
|
||||||
<!-- LOGO -->
|
<!-- LOGO -->
|
||||||
<div class="sidebar-header text-center py-4">
|
<div class="sidebar-header text-center py-4 px-10">
|
||||||
<img src="{{ asset('images/logo.png') }}" alt="Logo" class="img-fluid mb-2" style="max-height: 80px;">
|
<img src="{{ asset('images/logo.png') }}" alt="Logo" class="img-fluid mb-2" style="max-height: 80px;">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -230,26 +184,14 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- PROFILE BOX DI PALING BAWAH -->
|
|
||||||
<div class="sidebar-bottom border-top p-3">
|
|
||||||
<div class="d-flex align-items-center">
|
|
||||||
<img src="{{ asset('default-avatar.png') }}" alt="Admin" class="rounded-circle me-2"
|
|
||||||
style="width:40px; height:40px;">
|
|
||||||
<div>
|
|
||||||
<p class="mb-0 fw-semibold">{{ auth('admin')->user()->name }}</p>
|
|
||||||
<small class="text-muted">{{ auth('admin')->user()->email }}</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- MAIN CONTENT -->
|
<!-- MAIN CONTENT -->
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
@yield('content')
|
@yield('content')
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use App\Http\Controllers\AdminAuthController;
|
use App\Http\Controllers\AdminAuthController;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Route::get('/', function () {
|
||||||
|
return redirect()->route('admin.login');
|
||||||
|
});
|
||||||
Route::prefix('admin')->name('admin.')->group(function () {
|
Route::prefix('admin')->name('admin.')->group(function () {
|
||||||
Route::middleware('guest:admin')->group(function () {
|
Route::middleware('guest:admin')->group(function () {
|
||||||
Route::get('/login', [AdminAuthController::class, 'showLogin'])->name('login');
|
Route::get('/login', [AdminAuthController::class, 'showLogin'])->name('login');
|
||||||
@ -29,7 +34,6 @@ Route::prefix('admin')->name('admin.')->group(function () {
|
|||||||
|
|
||||||
|
|
||||||
use App\Http\Controllers\Api\ReviewController;
|
use App\Http\Controllers\Api\ReviewController;
|
||||||
|
|
||||||
use App\Models\Review;
|
use App\Models\Review;
|
||||||
|
|
||||||
Route::prefix('admin')->name('admin.')->middleware('auth:admin')->group(function () {
|
Route::prefix('admin')->name('admin.')->middleware('auth:admin')->group(function () {
|
||||||
@ -39,13 +43,18 @@ Route::prefix('admin')->name('admin.')->middleware('auth:admin')->group(function
|
|||||||
return view('admin.reviews.index', compact('reviews'));
|
return view('admin.reviews.index', compact('reviews'));
|
||||||
})->name('reviews.index');
|
})->name('reviews.index');
|
||||||
|
|
||||||
|
// Tambah ulasan
|
||||||
|
Route::post('/ulasan', [ReviewController::class, 'store'])->name('reviews.store');
|
||||||
|
|
||||||
|
// Update ulasan
|
||||||
|
Route::put('/ulasan/{review}', [ReviewController::class, 'update'])->name('reviews.update');
|
||||||
|
|
||||||
// Hapus ulasan
|
// Hapus ulasan
|
||||||
Route::delete('/ulasan/{review}', function (Review $review) {
|
Route::delete('/ulasan/{review}', function (Review $review) {
|
||||||
$review->delete();
|
$review->delete();
|
||||||
return redirect()->route('admin.reviews.index')->with('success', 'Ulasan berhasil dihapus');
|
return redirect()->route('admin.reviews.index')->with('success', 'Ulasan berhasil dihapus');
|
||||||
})->name('reviews.destroy');
|
})->name('reviews.destroy');
|
||||||
});
|
});
|
||||||
|
|
||||||
use App\Http\Controllers\FiturController;
|
use App\Http\Controllers\FiturController;
|
||||||
|
|
||||||
Route::prefix('admin')->name('admin.')->group(function () {
|
Route::prefix('admin')->name('admin.')->group(function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user