From b20dd54a6c8b78ff233c169a543fe8fa91a58ae8 Mon Sep 17 00:00:00 2001 From: sayasilvi Date: Thu, 25 Dec 2025 16:24:28 +0700 Subject: [PATCH] refactor: ui pembeli, petani and admin include card adjustmen with optimalization query --- .../{ => Admin}/AdminController.php | 13 +- app/Http/Controllers/CartController.php | 94 ++++-- app/Http/Controllers/LandingController.php | 21 +- .../Petani/DashboardController.php | 16 +- app/Models/Cart.php | 25 ++ .../2025_12_24_123129_create_carts_table.php | 24 ++ public/template/frontend/css/style.css | 2 +- resources/views/admin/dashboard.blade.php | 2 +- .../views/admin/transaksi_detail.blade.php | 25 +- .../views/admin/verifikasi/show.blade.php | 230 +++++++++++---- resources/views/auth/login.blade.php | 93 ++++-- resources/views/landing/cart.blade.php | 122 ++++++-- resources/views/landing/detail.blade.php | 43 +-- resources/views/landing/home.blade.php | 55 ++-- .../landing/partials/product_list.blade.php | 66 ++--- resources/views/landing/pesan/index.blade.php | 146 +++++++--- resources/views/landing/pesan/show.blade.php | 267 ++++++++---------- .../views/landing/pesanan_saya.blade.php | 3 - resources/views/landing/shop.blade.php | 53 ++-- resources/views/layouts/admin.blade.php | 31 +- resources/views/layouts/frontend.blade.php | 191 ++++--------- resources/views/petani/dashboard.blade.php | 8 +- .../views/petani/pesanan/detail.blade.php | 18 +- .../views/petani/pesanan/index.blade.php | 4 +- resources/views/petani/produk/edit.blade.php | 2 +- resources/views/petani/produk/index.blade.php | 158 ++++++----- routes/web.php | 2 +- 27 files changed, 970 insertions(+), 744 deletions(-) rename app/Http/Controllers/{ => Admin}/AdminController.php (87%) create mode 100644 app/Models/Cart.php create mode 100644 database/migrations/2025_12_24_123129_create_carts_table.php diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/Admin/AdminController.php similarity index 87% rename from app/Http/Controllers/AdminController.php rename to app/Http/Controllers/Admin/AdminController.php index d690dde..796dee0 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/Admin/AdminController.php @@ -1,7 +1,8 @@ get(); - return view('admin.verifikasi.index', compact('petanis')); } - // Tampilkan Detail Petani public function verifikasiShow($id) { $petani = Petani::findOrFail($id); return view('admin.verifikasi.show', compact('petani')); } - // Proses Terima Pendaftaran (Approve) public function verifikasiApprove($id) { $petani = Petani::findOrFail($id); - $petani->status_akun = 'aktif'; $petani->save(); return redirect('admin/verifikasi')->with('success', 'Pendaftaran Petani BERHASIL diterima.'); } - // Proses Tolak Pendaftaran (Reject) public function verifikasiReject($id) { $petani = Petani::findOrFail($id); - $petani->status_akun = 'ditolak'; $petani->save(); diff --git a/app/Http/Controllers/CartController.php b/app/Http/Controllers/CartController.php index 8af6b22..1322def 100644 --- a/app/Http/Controllers/CartController.php +++ b/app/Http/Controllers/CartController.php @@ -4,61 +4,95 @@ use Illuminate\Http\Request; use App\Models\Produk; +use App\Models\Cart; +use Illuminate\Support\Facades\Auth; class CartController extends Controller { // Menampilkan Halaman Keranjang public function index() { - $cart = session()->get('cart', []); + // Cek Login Pembeli + if (!Auth::guard('pembeli')->check()) { + return redirect()->route('login')->with('error', 'Silakan login terlebih dahulu untuk melihat keranjang.'); + } + + $pembeli_id = Auth::guard('pembeli')->id(); + + // Ambil data keranjang dari Database + $cart = Cart::with('produk')->where('pembeli_id', $pembeli_id)->get(); + return view('landing.cart', compact('cart')); } - // Menambahkan Produk ke Session Keranjang + // Menambahkan Produk ke DB Keranjang public function addToCart(Request $request) { - $id = $request->id; - $produk = Produk::findOrFail($id); - - $cart = session()->get('cart', []); - - // Validasi qty default ke 1 jika kosong - $quantity = $request->qty ? $request->qty : 1; - - if (isset($cart[$id])) { - $cart[$id]['quantity'] += $quantity; - } else { - $cart[$id] = [ - "name" => $produk->nama_produk, - "quantity" => $quantity, - "price" => $produk->harga, - "photo" => $produk->foto_produk - ]; + // Validasi Login + if (!Auth::guard('pembeli')->check()) { + return redirect()->route('login')->with('error', 'Silakan login dulu untuk belanja!'); + } + + $produk_id = $request->id; + $pembeli_id = Auth::guard('pembeli')->id(); + $quantity = $request->qty ? $request->qty : 1; + + // Cek stok produk + $produk = Produk::find($produk_id); + if ($produk->stok < $quantity) { + return redirect()->back()->with('error', 'Stok produk tidak mencukupi.'); + } + + // Cek produk yang ada di keranjang database user + $existingCart = Cart::where('pembeli_id', $pembeli_id) + ->where('produk_id', $produk_id) + ->first(); + + if ($existingCart) { + $existingCart->quantity += $quantity; + $existingCart->save(); + } else { + Cart::create([ + 'pembeli_id' => $pembeli_id, + 'produk_id' => $produk_id, + 'quantity' => $quantity + ]); } - session()->put('cart', $cart); return redirect()->back()->with('success', 'Produk berhasil masuk keranjang!'); } public function updateCart(Request $request) { + if (!Auth::guard('pembeli')->check()) { + return response()->json(['status' => 'error', 'message' => 'Unauthorized']); + } + if ($request->id && $request->quantity) { - $cart = session()->get('cart'); - $cart[$request->id]["quantity"] = $request->quantity; - session()->put('cart', $cart); - session()->flash('success', 'Keranjang berhasil diperbarui'); + $cartItem = Cart::where('id', $request->id) + ->where('pembeli_id', Auth::guard('pembeli')->id()) + ->first(); + + if ($cartItem) { + $cartItem->quantity = $request->quantity; + $cartItem->save(); + session()->flash('success', 'Keranjang berhasil diperbarui'); + } } } - // Menghapus Item dari Keranjang + // Menghapus Item dari DB Keranjang public function remove(Request $request) { + if (!Auth::guard('pembeli')->check()) { + return redirect()->route('login'); + } + if ($request->id) { - $cart = session()->get('cart'); - if (isset($cart[$request->id])) { - unset($cart[$request->id]); - session()->put('cart', $cart); - } + Cart::where('id', $request->id) + ->where('pembeli_id', Auth::guard('pembeli')->id()) + ->delete(); + return redirect()->back()->with('success', 'Produk dihapus dari keranjang'); } } diff --git a/app/Http/Controllers/LandingController.php b/app/Http/Controllers/LandingController.php index 0721158..25c94df 100644 --- a/app/Http/Controllers/LandingController.php +++ b/app/Http/Controllers/LandingController.php @@ -10,11 +10,17 @@ class LandingController extends Controller public function index(Request $request) { $query = Produk::with('petani')->latest(); + if ($request->has('kategori') && $request->kategori != '' && $request->kategori != 'Semua') { - $query->where('kategori', $request->kategori); + $slug = $request->kategori; + + $query->whereHas('kategori', function ($q) use ($slug) { + $q->where('slug', $slug); + }); } $produks = $query->take(8)->get(); + if ($request->ajax()) { return view('landing.partials.product_list', compact('produks'))->render(); } @@ -35,16 +41,19 @@ public function shop(Request $request) { $query = Produk::where('stok', '>', 0); - // Filter Kategori Berdasarkan Slug + if ($request->has('search') && $request->search != '') { + $query->where('nama_produk', 'like', '%' . $request->search . '%'); + } + + // Filter Kategori if ($request->has('kategori') && $request->kategori != '') { $slug = $request->kategori; - $query->whereHas('kategori', function ($q) use ($slug) { $q->where('slug', $slug); }); } - // Sorting (Urutkan) + // Sorting if ($request->has('sort')) { switch ($request->sort) { case 'termurah': @@ -73,8 +82,8 @@ public function detail($id) { $produk = Produk::with(['kategori', 'petani', 'images'])->findOrFail($id); - $produk_terkait = Produk::where('kategori_id', $produk->kategori_id) - ->where('id', '!=', $produk->id) + $produk_terkait = Produk::where('kategori_id', $produk->kategori_id) + ->where('id', '!=', $produk->id) ->where('stok', '>', 0) ->inRandomOrder() ->take(4) diff --git a/app/Http/Controllers/Petani/DashboardController.php b/app/Http/Controllers/Petani/DashboardController.php index 1630bb8..31486af 100644 --- a/app/Http/Controllers/Petani/DashboardController.php +++ b/app/Http/Controllers/Petani/DashboardController.php @@ -13,23 +13,31 @@ public function index() { $petaniId = Auth::guard('petani')->id(); - // + // 1. Hitung Total Produk Aktif $totalProduk = Produk::where('petani_id', $petaniId)->count(); - // Hitung Pesanan Baru + // 2. Hitung Pesanan Baru (Yang statusnya 'dibayar' / perlu diproses) $pesananBaru = DetailTransaksi::whereHas('produk', function($q) use ($petaniId) { $q->where('petani_id', $petaniId); })->whereHas('transaksi', function($q) { $q->where('status', 'dibayar'); })->count(); - // Hitung Total Pendapatan + // 3. Hitung TOTAL SEMUA PEMESANAN (Valid) + // Menghitung semua transaksi masuk (Dibayar, Dikirim, Selesai) kecuali yang Batal + $totalPemesanan = DetailTransaksi::whereHas('produk', function($q) use ($petaniId) { + $q->where('petani_id', $petaniId); + })->whereHas('transaksi', function($q) { + $q->where('status', '!=', 'batal'); // Ambil semua kecuali yang batal + })->count(); + + // 4. Hitung Total Pendapatan (Hanya yang status 'selesai') $totalPendapatan = DetailTransaksi::whereHas('produk', function($q) use ($petaniId) { $q->where('petani_id', $petaniId); })->whereHas('transaksi', function($q) { $q->where('status', 'selesai'); })->sum('subtotal'); - return view('petani.dashboard', compact('totalProduk', 'pesananBaru', 'totalPendapatan')); + return view('petani.dashboard', compact('totalProduk', 'pesananBaru', 'totalPemesanan', 'totalPendapatan')); } } \ No newline at end of file diff --git a/app/Models/Cart.php b/app/Models/Cart.php new file mode 100644 index 0000000..a635d32 --- /dev/null +++ b/app/Models/Cart.php @@ -0,0 +1,25 @@ +belongsTo(Produk::class, 'produk_id'); + } + + // Relasi ke Pembeli + public function pembeli() + { + return $this->belongsTo(Pembeli::class, 'pembeli_id'); + } +} \ No newline at end of file diff --git a/database/migrations/2025_12_24_123129_create_carts_table.php b/database/migrations/2025_12_24_123129_create_carts_table.php new file mode 100644 index 0000000..0a025dd --- /dev/null +++ b/database/migrations/2025_12_24_123129_create_carts_table.php @@ -0,0 +1,24 @@ +id(); + $table->foreignId('pembeli_id')->constrained('pembelis')->onDelete('cascade'); + $table->foreignId('produk_id')->constrained('produks')->onDelete('cascade'); + $table->integer('quantity')->default(1); + $table->timestamps(); + }); + } + + public function down() + { + Schema::dropIfExists('carts'); + } +}; \ No newline at end of file diff --git a/public/template/frontend/css/style.css b/public/template/frontend/css/style.css index 3280efd..9370d5b 100644 --- a/public/template/frontend/css/style.css +++ b/public/template/frontend/css/style.css @@ -159,7 +159,7 @@ @media (min-width: 1200px) { .dropdown .dropdown-menu a:hover { background: var(--bs-secondary); - color: var(--bs-primary); + color: var(--bs-primary);z } .navbar .nav-item:hover .dropdown-menu { diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 4bf21ff..7afdf45 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -33,7 +33,7 @@
-
Verifikasi Pending
+
Verifikasi Masuk
{{ $petaniPending }}
diff --git a/resources/views/admin/transaksi_detail.blade.php b/resources/views/admin/transaksi_detail.blade.php index 6a7f014..9203ffa 100644 --- a/resources/views/admin/transaksi_detail.blade.php +++ b/resources/views/admin/transaksi_detail.blade.php @@ -2,18 +2,23 @@ @section('title', 'Detail Transaksi') +@section('page-title') +
+
+
+ Daftar Transaksi +

/ Detail Pesanan

+
+

Invoice: #{{ $transaksi->kode_invoice }}

+
+ + Kembali + +
+@endsection + @section('content')
-
-
-

Detail Transaksi

- Invoice: #{{ $transaksi->kode_invoice }} -
- - Kembali - -
-
diff --git a/resources/views/admin/verifikasi/show.blade.php b/resources/views/admin/verifikasi/show.blade.php index 1fd9003..6c75b48 100644 --- a/resources/views/admin/verifikasi/show.blade.php +++ b/resources/views/admin/verifikasi/show.blade.php @@ -1,75 +1,201 @@ @extends('layouts.admin') @section('title', 'Detail Petani') -@section('page-title', 'Detail Calon Petani') - -@section('content') -
-
-
-
-

Data Diri

+@section('page-title') +
+
+ Daftar Verifikasi +

/ Detail Verifikasi Akun Petani

-
- + +@endsection +@section('content') + + +
+ + {{-- 1. KOLOM KIRI: DATA LENGKAP (Desain Clean List - Pilihan Kamu) --}} +
+
+
+
+
+ Data Calon Petani +
+ {{-- Badge Status di Header Kiri --}} + @if($petani->status_akun == 'menunggu') + Menunggu Verifikasi + @elseif($petani->status_akun == 'aktif') + Terverifikasi + @else + Ditolak + @endif +
+
+
+
- - + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + +
Nama Lengkap: {{ $petani->nama_lengkap }}Nama Lengkap{{ $petani->nama_lengkap }}
Username: {{ $petani->username }}Username{{ $petani->username }}
No HP: {{ $petani->no_hp }}
Alamat: {{ $petani->alamat }}
Nama Usaha: {{ $petani->nama_usaha }}
Status Saat Ini: - - {{ ucfirst($petani->status_akun) }} - + Nomor WhatsApp + {{ $petani->no_hp }} + + Chat +
Nama Usaha Tani{{ $petani->nama_usaha }}
Alamat Lengkap{{ $petani->alamat }}
Terdaftar Sejak{{ $petani->created_at->format('d F Y, H:i') }} WIB
-
-
-
-

Aksi Verifikasi

+ {{-- 2. KOLOM KANAN: TIMELINE & AKSI (Log Style) --}} +
+
+
+
Riwayat Status
-
-

Silakan tinjau data di samping. Jika valid, klik Terima.

+
-
- @csrf - -
+ {{-- TIMELINE LOG --}} +
+ + {{-- STEP 1: REGISTRASI (Pasti Ada) --}} +
+
+
+ +
+
+
+
+
Registrasi Masuk
+ {{ $petani->created_at->format('d M Y, H:i') }} + Data Diterima +
+
+ + {{-- STEP 2: MENUNGGU VERIFIKASI (Step Tengah) --}} +
+
+ {{-- Jika status menunggu, icon kuning. Jika sudah lewat (aktif/tolak), icon biru (selesai) --}} + @if($petani->status_akun == 'menunggu') +
+ +
+
+ @else +
+ +
+
+ @endif +
+
+
Proses Verifikasi
+ @if($petani->status_akun == 'menunggu') + Sedang ditinjau... + Pending + @else + {{-- Jika sudah diproses, ambil waktunya --}} + {{ $petani->updated_at->format('d M Y, H:i') }} + Selesai Ditinjau + @endif +
+
+ + {{-- STEP 3: HASIL AKHIR --}} +
+
+ @if($petani->status_akun == 'aktif') +
+ +
+ @elseif($petani->status_akun == 'ditolak') +
+ +
+ @else + {{-- Icon abu-abu jika belum sampai tahap ini --}} +
+ +
+ @endif +
+
+
Keputusan Admin
+ @if($petani->status_akun == 'menunggu') + Menunggu tindakan Anda... + @elseif($petani->status_akun == 'aktif') + {{ $petani->updated_at->format('d M Y, H:i') }} + Disetujui + @else + {{ $petani->updated_at->format('d M Y, H:i') }} + Ditolak + @endif +
+
-
- @csrf - -
- - + +
+ + {{-- PANEL TOMBOL AKSI (Hanya muncul jika MENUNGGU) --}} + @if($petani->status_akun == 'menunggu') +
+
+ +
Pastikan data di samping valid sebelum memproses.
+
+ +
+
+ @csrf + +
+ +
+ @csrf + +
+
+
+ @else + {{-- Pesan Status Akhir --}} +
+
+ STATUS AKHIR: {{ strtoupper($petani->status_akun) }} +
+
+ @endif +
diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 00d76d1..dac3710 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,22 +1,68 @@ + Masuk - GriyaPadi.id - + +
@@ -28,33 +74,42 @@

Masuk untuk melanjutkan

- @if(session('success'))
{{ session('success') }}
@endif - @if($errors->any())
{{ $errors->first() }}
@endif + @if(session('success')) +
{{ session('success') }}
@endif + @if($errors->any()) +
{{ $errors->first() }}
@endif
@csrf
- - + +
- - + + {{-- Icon Mata --}} - +
@@ -63,7 +118,8 @@
- Belum punya akun? Daftar + Belum punya akun? Daftar
@@ -73,7 +129,7 @@ function togglePassword(inputId, iconId) { const input = document.getElementById(inputId); const icon = document.getElementById(iconId); - + if (input.type === "password") { input.type = "text"; icon.classList.remove("fa-eye"); @@ -86,4 +142,5 @@ function togglePassword(inputId, iconId) { } + \ No newline at end of file diff --git a/resources/views/landing/cart.blade.php b/resources/views/landing/cart.blade.php index 21e41ef..e27813f 100644 --- a/resources/views/landing/cart.blade.php +++ b/resources/views/landing/cart.blade.php @@ -6,24 +6,22 @@

Keranjang Belanja

- {{-- Alert Notification --}} - @if (session('success')) - - @endif - - @if (count($cart) > 0) + @if ($cart->count() > 0)
- + - + {{-- CHECKBOX HEADER --}} + + @@ -32,50 +30,60 @@ @php $total_belanja = 0; @endphp - @foreach ($cart as $id => $details) + + @foreach ($cart as $item) @php - $total = $details['price'] * $details['quantity']; - $total_belanja += $total; + $total_per_item = $item->produk->harga * $item->quantity; + $total_belanja += $total_per_item; @endphp - - + {{-- CHECKBOX ITEM --}} + + + - diff --git a/resources/views/petani/produk/edit.blade.php b/resources/views/petani/produk/edit.blade.php index d298647..b3d9ec2 100644 --- a/resources/views/petani/produk/edit.blade.php +++ b/resources/views/petani/produk/edit.blade.php @@ -137,7 +137,7 @@ class="form-control form-control-sm" accept="image/*" multiple>
Batal - +
diff --git a/resources/views/petani/produk/index.blade.php b/resources/views/petani/produk/index.blade.php index 446dfbc..9c52548 100644 --- a/resources/views/petani/produk/index.blade.php +++ b/resources/views/petani/produk/index.blade.php @@ -4,85 +4,87 @@ @section('page-title', 'Daftar Produk Saya') @section('content') -
-
-

List Produk Pertanian

- - Tambah Produk - -
-
- @if(session('success')) -
Produk +
+ +
+
Produk Harga Jumlah Total
+ +
+
+ +
+
- - {{ $details['name'] }} + {{ $item->produk->nama_produk }}
Rp - {{ number_format($details['price'], 0, ',', '.') }} + {{ number_format($item->produk->harga, 0, ',', '.') }}
- {{-- Tombol Minus --}} - {{-- Input Jumlah --}} + value="{{ $item->quantity }}" readonly style="min-width: 40px;"> - {{-- Tombol Plus --}}
Rp {{ number_format($total, 0, ',', '.') }} + Rp {{ number_format($total_per_item, 0, ',', '.') }}
@csrf @method('DELETE') - + + + Semua + + + {{-- 2. Looping Kategori dari Database --}} + @foreach($kategoriList as $kat) + + {{ $kat->nama_kategori }} + @endforeach @@ -235,13 +240,16 @@ class="btn btn-light rounded-pill px-5 py-3 text-success fw-bold shadow"> @section('js') -@endsection +@endsection \ No newline at end of file diff --git a/resources/views/landing/partials/product_list.blade.php b/resources/views/landing/partials/product_list.blade.php index 233d9b6..26534f5 100644 --- a/resources/views/landing/partials/product_list.blade.php +++ b/resources/views/landing/partials/product_list.blade.php @@ -1,45 +1,39 @@ @forelse($produks as $produk) -
-
-
- - {{ $produk->kategori ?? 'Padi' }} - -
- -
- +
+
+
+ Stok: {{ $produk->stok }} Kg
-
+
{{ $produk->nama_produk }} + class="card-img-top w-100 h-100 object-fit-cover" alt="{{ $produk->nama_produk }}">
-
- - {{ Str::limit($produk->petani->nama_lengkap ?? 'Petani Lokal', 15) }} - - -
- {{ $produk->nama_produk }} -
+
+
+ + {{ $produk->kategori->nama_kategori ?? 'Umum' }} + -

- {{ Str::limit($produk->deskripsi, 60) }} -

+
{{ $produk->nama_produk }}
-
+

+ {{ Str::limit($produk->deskripsi, 60) }} +

+
+ +
- Harga per Kg -
+ Harga/Kg +
Rp {{ number_format($produk->harga, 0, ',', '.') }} -
+
+ class="btn btn-primary btn-sm rounded-pill px-3 stretched-link"> Lihat
@@ -48,15 +42,13 @@ class="btn btn-outline-success btn-sm stretched-link">
@empty
-
-
- -
-

Belum Ada Panen

-

Produk kategori ini sedang tidak tersedia.

- +
+ +
Belum ada stok gabah tersedia.
+

Silakan cek kembali saat musim panen tiba atau reset filter pencarian Anda.

+ + Reset Filter +
@endforelse \ No newline at end of file diff --git a/resources/views/landing/pesan/index.blade.php b/resources/views/landing/pesan/index.blade.php index 23cf8a5..b83108e 100644 --- a/resources/views/landing/pesan/index.blade.php +++ b/resources/views/landing/pesan/index.blade.php @@ -1,57 +1,129 @@ @extends('layouts.frontend') @section('title', 'Pesan Saya') +@section('css') + +@endsection + @section('content')

Pesan Saya

-
+ {{-- Container Utama --}} +
+ + {{-- KOLOM KIRI: DAFTAR PESAN --}}
-
- + -
- @forelse($chatList as $chat) - -
-
- - @if ($chat['unread'] > 0) - - {{ $chat['unread'] }} - - @endif -
-
- -
-
- -
Selamat Datang di Chat
-

Pilih salah satu percakapan di sebelah kiri
untuk melihat detail pesan.

+ {{-- KOLOM KANAN: PLACEHOLDER --}} +
+
+
+ +
+
Selamat Datang di Chat
+

Pilih salah satu percakapan di sebelah kiri
untuk mulai berdiskusi dengan Petani.

-@endsection +@endsection \ No newline at end of file diff --git a/resources/views/landing/pesan/show.blade.php b/resources/views/landing/pesan/show.blade.php index 73e930f..104136e 100644 --- a/resources/views/landing/pesan/show.blade.php +++ b/resources/views/landing/pesan/show.blade.php @@ -1,136 +1,120 @@ @extends('layouts.frontend') @section('title', 'Chat dengan ' . $lawan->nama_lengkap) +@section('css') + +@endsection + @section('content') - -
-
+ @@ -172,14 +152,12 @@ class="position-absolute top-0 start-100 translate-middle p-1 bg-danger border b {{-- AREA CHAT KANAN --}}
- {{-- Header Chat --}} + {{-- Header Chat --}}
- + - {{-- Inisial Nama Lawan --}} -
{{ substr($lawan->nama_lengkap, 0, 1) }}
@@ -205,22 +183,17 @@ class="fas fa-arrow-left"> $isMe = ($chat->pengirim_id == $currentUser->id) && ($chat->pengirim_type == $currentUserType); @endphp - {{-- BUBBLE CHAT --}}
{{ $chat->isi_pesan }} - + {{ $chat->created_at->format('H:i') }} - @if ($isMe) - - @endif + @if ($isMe) @endif
- @empty
-

Belum ada percakapan.
Sapa - {{ $lawan->nama_lengkap }} sekarang!

+

Mulai percakapan dengan
{{ $lawan->nama_lengkap }}

@endforelse
@@ -233,11 +206,10 @@ class="fas fa-arrow-left"> + placeholder="Tulis pesan..." required autocomplete="off"> - @@ -251,7 +223,6 @@ class="btn btn-send rounded-circle d-flex align-items-center justify-content-cen @section('js') @@ -383,4 +304,4 @@ class="bi bi-arrow-up"> @yield('js') - + \ No newline at end of file diff --git a/resources/views/petani/dashboard.blade.php b/resources/views/petani/dashboard.blade.php index ff9ebc9..5372bd3 100644 --- a/resources/views/petani/dashboard.blade.php +++ b/resources/views/petani/dashboard.blade.php @@ -24,7 +24,7 @@
- {{-- Card 2: Pesanan Baru --}} + {{-- Card Pemesanan --}}
@@ -35,15 +35,15 @@
-
Pesanan Baru
-
{{ $pesananBaru }}
+
Pemesanan
+
{{ $totalPemesanan }}
- {{-- Card 3: Total Pendapatan --}} + {{-- Card Total Pendapatan --}}
diff --git a/resources/views/petani/pesanan/detail.blade.php b/resources/views/petani/pesanan/detail.blade.php index 2bf5e9d..2a70ca9 100644 --- a/resources/views/petani/pesanan/detail.blade.php +++ b/resources/views/petani/pesanan/detail.blade.php @@ -4,7 +4,10 @@ @section('page-title')
@@ -79,7 +82,7 @@ class="badge bg-primary-green">{{ $detail->produk->kategori->nama_kategori ?? 'U @if($pesanan->status == 'menunggu_konfirmasi' || $pesanan->status == 'menunggu konfirmasi')
-
+
Perlu Konfirmasi

Pastikan stok tersedia sebelum menerima pesanan ini.

@@ -103,9 +106,8 @@ class="badge bg-primary-green">{{ $detail->produk->kategori->nama_kategori ?? 'U
@elseif($pesanan->status == 'diproses')
-
-
- +
+
Sedang Diproses

Klik tombol di bawah jika barang sudah diserahkan ke kurir.

@@ -113,7 +115,7 @@ class="badge bg-primary-green">{{ $detail->produk->kategori->nama_kategori ?? 'U @csrf @method('PATCH')
diff --git a/resources/views/petani/pesanan/index.blade.php b/resources/views/petani/pesanan/index.blade.php index 4742060..025ca29 100644 --- a/resources/views/petani/pesanan/index.blade.php +++ b/resources/views/petani/pesanan/index.blade.php @@ -10,7 +10,7 @@
@if(session('success')) -
{{ session('success') }}
+
{{ session('success') }}
@endif
@@ -59,7 +59,7 @@
- Lihat Detail + Detail
+ + + + + + + + + + + @forelse($produks as $produk) + + + + + + + + @empty + + + + @endforelse + +
FotoNama ProdukHarga (Rp)StokAksi
+ @if($produk->foto_produk) + {{ $produk->nama_produk }} + @else + No Image + @endif + +

{{ $produk->nama_produk }}

+ {{ Str::limit($produk->deskripsi, 50) }} +
Rp {{ number_format($produk->harga, 0, ',', '.') }} + @if($produk->stok > 0) + {{ $produk->stok }} kg + @else + Habis + @endif + + {{-- Tombol Edit --}} + + + + + {{-- Form Hapus --}} +
+ @csrf + @method('DELETE') + +
+
+ +

Belum ada produk yang dijual.

+ Tambah Produk + Sekarang +
- @endif - -
- - - - - - - - - - - - @forelse($produks as $produk) - - - - - - - - @empty - - - - @endforelse - -
FotoNama ProdukHarga (Rp)StokAksi
- @if($produk->foto_produk) - {{ $produk->nama_produk }} - @else - No Image - @endif - -

{{ $produk->nama_produk }}

- {{ Str::limit($produk->deskripsi, 50) }} -
Rp {{ number_format($produk->harga, 0, ',', '.') }} - @if($produk->stok > 0) - {{ $produk->stok }} kg - @else - Habis - @endif - - {{-- Tombol Edit --}} - - - - - {{-- Form Hapus --}} -
- @csrf - @method('DELETE') - -
-
- -

Belum ada produk yang dijual.

- Tambah Produk Sekarang -
-
@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 029dcfc..7cc26e2 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,7 +3,7 @@ use App\Http\Controllers\Admin\KategoriController; use Illuminate\Support\Facades\Route; use App\Http\Controllers\AuthController; -use App\Http\Controllers\AdminController; +use App\Http\Controllers\Admin\AdminController; use App\Http\Controllers\CartController; use App\Http\Controllers\ForgotPasswordController; use App\Http\Controllers\LandingController;