mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-03 16:59:32 -05:00
Reapply "Merge pull request #3380 from Roardom/livewire-types"
This reverts commit b4a9dfea8b.
This commit is contained in:
@@ -15,6 +15,7 @@ namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\BonTransactions;
|
||||
use App\Models\User;
|
||||
use App\Traits\LivewireSort;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
@@ -23,6 +24,7 @@ use Livewire\WithPagination;
|
||||
*/
|
||||
class GiftLogSearch extends Component
|
||||
{
|
||||
use LivewireSort;
|
||||
use WithPagination;
|
||||
|
||||
public string $sender = '';
|
||||
@@ -37,6 +39,9 @@ class GiftLogSearch extends Component
|
||||
|
||||
public int $perPage = 25;
|
||||
|
||||
/**
|
||||
* @var array<mixed>
|
||||
*/
|
||||
protected $queryString = [
|
||||
'sender' => ['except' => ''],
|
||||
'receiver' => ['except' => ''],
|
||||
@@ -49,6 +54,9 @@ class GiftLogSearch extends Component
|
||||
$this->emit('paginationChanged');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator<BonTransactions>
|
||||
*/
|
||||
final public function getGiftsProperty(): \Illuminate\Contracts\Pagination\LengthAwarePaginator
|
||||
{
|
||||
return BonTransactions::with([
|
||||
@@ -69,15 +77,4 @@ class GiftLogSearch extends Component
|
||||
'gifts' => $this->gifts,
|
||||
]);
|
||||
}
|
||||
|
||||
final public function sortBy($field): void
|
||||
{
|
||||
if ($this->sortField === $field) {
|
||||
$this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
$this->sortDirection = 'asc';
|
||||
}
|
||||
|
||||
$this->sortField = $field;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user