Skip to content

Commit

Permalink
Return data to the verify payments UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed May 22, 2024
1 parent 430e3bb commit 4b9db02
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
17 changes: 15 additions & 2 deletions app/Livewire/VerifyPayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
);
}
}
10 changes: 6 additions & 4 deletions resources/views/livewire/manage-users.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
<div class="max-w-7xl text-black/80 relative h-full mx-auto">
<div class="flex sm:mx-3 lg:mx-4 flex-col h-full md:flex-row">
<div class="w-full md:pr-2 flex-col">
<div class="rounded-lg p-4 relative w-full bg-white">
<h1>Manage Users</h1>
<div class="rounded-lg h-[85vh] overflow-scroll p-4 relative w-full bg-white">
<h1 class="text-2xl font-semibold my-4 text-center text-gray-800">
Manage Users
</h1>
<div class="card-header max-w-md relative">
<input type="text" wire:model.live="search" class="w-full p-2 border border-gray-300 rounded-lg"
placeholder="Search Users">
<i class="fas fa-search absolute top-3 right-3 text-gray-400"></i>
</div>
<table class="table my-4 ring-1 ring-blue-200 overflow-clip">
<thead>
<tr class="bg-gray-100 text-gray-600 text-sm">
<tr class="bg-gray-100 border-blue-300 text-gray-600 text-sm">
<th>Id</th>
<th>Avatar</th>
<th>Name</th>
Expand All @@ -28,7 +30,7 @@
</thead>
<tbody>
@foreach($users as $user)
<tr>
<tr class="border-blue-200">
<td>{{ $user->id }}</td>
<td>
<img src="{{ $user->profile_photo }}" alt="{{ $user->name }}"
Expand Down

0 comments on commit 4b9db02

Please sign in to comment.