diff --git a/app/Livewire/BookingPage.php b/app/Livewire/BookingPage.php index 9d46df6..bf9c25c 100644 --- a/app/Livewire/BookingPage.php +++ b/app/Livewire/BookingPage.php @@ -127,6 +127,7 @@ public function placeOrder() // Tampilkan pesan sukses dan redirect session()->flash('message', 'Booking berhasil dibuat! Silahkan lakukan pembayaran sesuai metode yang dipilih.'); + session()->flash('booking_name', $this->nama); return redirect()->route('booking.success'); } diff --git a/app/Livewire/SuccesPage.php b/app/Livewire/SuccesPage.php index b774779..087e0ca 100644 --- a/app/Livewire/SuccesPage.php +++ b/app/Livewire/SuccesPage.php @@ -2,10 +2,26 @@ namespace App\Livewire; +use App\Models\Reservasii; use Livewire\Component; class SuccesPage extends Component { + public $booking; + public $bookingName; + + public function mount() + { + // Ambil booking terakhir dari user yang sedang login + $this->booking = Reservasii::with(['user', 'detail.paketFoto']) + ->where('user_id', auth()->id()) + ->latest() + ->first(); + + // Ambil nama dari session + $this->bookingName = session('booking_name'); + } + public function render() { return view('livewire.succes-page'); diff --git a/resources/views/livewire/succes-page.blade.php b/resources/views/livewire/succes-page.blade.php index 779a5e4..2180bba 100644 --- a/resources/views/livewire/succes-page.blade.php +++ b/resources/views/livewire/succes-page.blade.php @@ -8,10 +8,8 @@

- Cielo Schimmel

-

71582 Schmitt Springs

-

Castro Valley, Delaware, 53476-0454

-

Phone: 587-019-6103

+ {{ $bookingName }}

+

{{ $booking->user->email }}

@@ -21,31 +19,31 @@

Order Number:

- 29

+ {{ $booking->id }}

Tanggal:

- 17-02-2024

+ {{ \Carbon\Carbon::parse($booking->tanggal)->format('d-m-Y') }}

Waktu:

- 29

+ {{ \Carbon\Carbon::parse($booking->waktu)->format('H:i') }}

Total:

- ₹157,495.00

+ Rp {{ number_format($booking->total, 0, ',', '.') }}

Payment Method:

- Cash on Delivery

+ {{ ucfirst($booking->metode_pembayaran) }}

@@ -53,19 +51,19 @@

Order details

+ @foreach($booking->detail as $detail)
-

Subtotal

-

₹157,495.00

+

{{ $detail->paketFoto->nama_paket_foto }}

+

Rp {{ number_format($detail->total_harga, 0, ',', '.') }}

-
-

Discount -

-

00

+
+

Background: {{ ucfirst($detail->warna) }}

+ @endforeach

Total

-

₹157,495.00

+

Rp {{ number_format($booking->total, 0, ',', '.') }}

@@ -75,7 +73,7 @@ Kembali - Lihat + Lihat Histori