diff --git a/backend/app/Http/Controllers/Api/ReviewController.php b/backend/app/Http/Controllers/Api/ReviewController.php
index 69731ac..7790b30 100644
--- a/backend/app/Http/Controllers/Api/ReviewController.php
+++ b/backend/app/Http/Controllers/Api/ReviewController.php
@@ -9,10 +9,12 @@ use App\Models\Review;
class ReviewController extends Controller
{
// Ambil semua ulasan
- public function index()
- {
- return response()->json(Review::all(), 200);
- }
+ public function index()
+{
+ $reviews = Review::all();
+ return view('admin.reviews.index', compact('reviews'));
+}
+
// Simpan ulasan baru
public function store(Request $request)
diff --git a/backend/app/Http/Controllers/KategoriController.php b/backend/app/Http/Controllers/KategoriController.php
index 9f85398..17fbbbf 100644
--- a/backend/app/Http/Controllers/KategoriController.php
+++ b/backend/app/Http/Controllers/KategoriController.php
@@ -7,10 +7,12 @@ use Illuminate\Support\Facades\Storage;
class KategoriController extends Controller
{
- public function index()
- {
- return response()->json(Kategori::all(), 200);
- }
+ public function index()
+{
+ $kategori = Kategori::all();
+ return view('admin.kategori.index', compact('kategori'));
+}
+
public function show(Kategori $kategori)
{
diff --git a/backend/resources/views/admin/dashboard.blade.php b/backend/resources/views/admin/dashboard.blade.php
index b76f564..8bb0319 100644
--- a/backend/resources/views/admin/dashboard.blade.php
+++ b/backend/resources/views/admin/dashboard.blade.php
@@ -1,115 +1,113 @@
-
-
+@extends('layouts.app')
-
-
-
-
-
Halaman Dasbor
-
-
-
-
- {{ \Carbon\Carbon::now()->translatedFormat('l, d F Y') }}
-
-
-
-
+
+
+
+ {{ \Carbon\Carbon::now()->translatedFormat('l, d F Y') }}
-
-
-
-
-
-
- Berhasil login sebagai {{ auth('admin')->user()->name }}
+
+
-
+
+
-
+
+
+ Berhasil login sebagai {{ auth('admin')->user()->name }}
+
+
+
+@endsection
diff --git a/backend/resources/views/admin/kategori/index.blade.php b/backend/resources/views/admin/kategori/index.blade.php
new file mode 100644
index 0000000..8ef96f5
--- /dev/null
+++ b/backend/resources/views/admin/kategori/index.blade.php
@@ -0,0 +1,135 @@
+@extends('layouts.app')
+
+@section('title', 'Manajemen Kategori')
+
+@section('content')
+
+
+
+
Manajemen Kategori
+
+
+
+
+
+
+
+
+
+ No |
+ Foto |
+ Nama |
+ Deskripsi |
+ Aksi |
+
+
+
+ @forelse ($kategori as $key => $item)
+
+ {{ $key + 1 }} |
+
+ @if($item->foto)
+
+ @else
+
+ @endif
+ |
+ {{ $item->nama }} |
+ {{ $item->deskripsi ?? '-' }} |
+
+
+
+ |
+
+
+
+
+ @empty
+
+ Belum ada kategori |
+
+ @endforelse
+
+
+
+
+
+
+
+
+
+
+
+
+@endsection
diff --git a/backend/resources/views/admin/reviews/index.blade.php b/backend/resources/views/admin/reviews/index.blade.php
new file mode 100644
index 0000000..79e667f
--- /dev/null
+++ b/backend/resources/views/admin/reviews/index.blade.php
@@ -0,0 +1,109 @@
+@extends('layouts.app')
+
+@section('title', 'Manajemen Ulasan')
+
+@section('content')
+
+
+
Manajemen Ulasan
+
+ {{-- Info kecil bahwa tambah data via Postman --}}
+
+
+
+ {{-- Alert sukses --}}
+ @if(session('success'))
+
{{ session('success') }}
+ @endif
+
+ {{-- Tabel Ulasan --}}
+
+
+
+
+
+
+ No |
+ Nama |
+ Kota |
+ Rating |
+ Pesan |
+ Aksi |
+
+
+
+ @forelse ($reviews as $i => $review)
+
+ {{ $i + 1 }} |
+ {{ $review->name }} |
+ {{ $review->city }} |
+
+ @for($s=1; $s<=5; $s++)
+
+ @endfor
+ |
+ {{ $review->message }} |
+
+
+ |
+
+ @empty
+
+ Belum ada ulasan |
+
+ @endforelse
+
+
+
+
+
+
+
+
+
+{{-- Modal Konfirmasi Hapus (satu modal untuk semua baris) --}}
+
+
+
+
+
+
+{{-- Script kecil untuk set action form hapus --}}
+
+@endsection
+
\ No newline at end of file
diff --git a/backend/resources/views/layouts/app.blade.php b/backend/resources/views/layouts/app.blade.php
new file mode 100644
index 0000000..ab227c2
--- /dev/null
+++ b/backend/resources/views/layouts/app.blade.php
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
@yield('title', 'Admin Panel')
+
+
+
+
+
+
+
+
+
+
+
+
+ @yield('content')
+
+
+
+
+
+
diff --git a/backend/routes/web.php b/backend/routes/web.php
index 85bea31..3597f3a 100644
--- a/backend/routes/web.php
+++ b/backend/routes/web.php
@@ -17,3 +17,32 @@ Route::prefix('admin')->name('admin.')->group(function () {
Route::post('/logout', [AdminAuthController::class, 'logout'])->name('logout');
});
});
+
+use App\Http\Controllers\KategoriController;
+
+Route::prefix('admin')->name('admin.')->group(function () {
+ Route::get('/kategori', [KategoriController::class, 'index'])->name('kategori.index');
+ Route::post('/kategori', [KategoriController::class, 'store'])->name('kategori.store');
+ Route::put('/kategori/{kategori}', [KategoriController::class, 'update'])->name('kategori.update');
+ Route::delete('/kategori/{kategori}', [KategoriController::class, 'destroy'])->name('kategori.destroy');
+});
+
+
+use App\Http\Controllers\Api\ReviewController;
+
+use App\Models\Review;
+
+Route::prefix('admin')->name('admin.')->middleware('auth:admin')->group(function () {
+ // Halaman daftar ulasan
+ Route::get('/ulasan', function () {
+ $reviews = \App\Models\Review::latest()->get();
+ return view('admin.reviews.index', compact('reviews'));
+ })->name('reviews.index');
+
+ // Hapus ulasan
+ Route::delete('/ulasan/{review}', function (Review $review) {
+ $review->delete();
+ return redirect()->route('admin.reviews.index')->with('success', 'Ulasan berhasil dihapus');
+ })->name('reviews.destroy');
+});
+