From 4b9db021d0ade82ad7f51a553539d147205edfff Mon Sep 17 00:00:00 2001 From: raccoon254 Date: Wed, 22 May 2024 23:54:26 +0300 Subject: [PATCH] Return data to the verify payments UI --- app/Livewire/VerifyPayments.php | 17 +++++++++++++++-- resources/views/livewire/manage-users.blade.php | 10 ++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/Livewire/VerifyPayments.php b/app/Livewire/VerifyPayments.php index a83820d..412ab10 100644 --- a/app/Livewire/VerifyPayments.php +++ b/app/Livewire/VerifyPayments.php @@ -2,12 +2,25 @@ namespace App\Livewire; +use App\Models\Payment; +use Illuminate\View\View; use Livewire\Component; class VerifyPayments extends Component { - public function render() + public string $search = ''; + public function render(): View { - return view('livewire.verify-payments'); + $payments = Payment::where('order_id', 'like', '%' . $this->search . '%') + ->orWhere('amount', 'like', '%' . $this->search . '%') + ->orWhere('payment_method', 'like', '%' . $this->search . '%') + ->orWhere('status', 'like', '%' . $this->search . '%') + ->paginate(40); + + return view('livewire.verify-payments', + [ + 'payments' => $payments + ] + ); } } diff --git a/resources/views/livewire/manage-users.blade.php b/resources/views/livewire/manage-users.blade.php index ad77701..2a13a6a 100644 --- a/resources/views/livewire/manage-users.blade.php +++ b/resources/views/livewire/manage-users.blade.php @@ -8,8 +8,10 @@
-
-

Manage Users

+
+

+ Manage Users +

@@ -17,7 +19,7 @@
- + @@ -28,7 +30,7 @@ @foreach($users as $user) - +
Id Avatar Name
{{ $user->id }}