mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-29 06:51:30 -05:00
update: livewire
This commit is contained in:
@@ -16,6 +16,8 @@ namespace App\Http\Livewire;
|
||||
use App\Models\Invite;
|
||||
use App\Traits\LivewireSort;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Livewire\Attributes\Computed;
|
||||
use Livewire\Attributes\Url;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
@@ -24,43 +26,36 @@ class InviteLogSearch extends Component
|
||||
use LivewireSort;
|
||||
use WithPagination;
|
||||
|
||||
#[Url]
|
||||
public string $sender = '';
|
||||
|
||||
#[Url]
|
||||
public string $email = '';
|
||||
|
||||
#[Url]
|
||||
public string $code = '';
|
||||
|
||||
#[Url]
|
||||
public string $receiver = '';
|
||||
|
||||
#[Url]
|
||||
public string $custom = '';
|
||||
|
||||
#[Url]
|
||||
public string $groupBy = 'none';
|
||||
|
||||
#[Url]
|
||||
public int $threshold = 25;
|
||||
|
||||
#[Url]
|
||||
public string $sortField = 'created_at';
|
||||
|
||||
#[Url]
|
||||
public string $sortDirection = 'desc';
|
||||
|
||||
#[Url]
|
||||
public int $perPage = 25;
|
||||
|
||||
/**
|
||||
* @var array<mixed>
|
||||
*/
|
||||
protected $queryString = [
|
||||
'sender' => ['except' => ''],
|
||||
'email' => ['except' => ''],
|
||||
'code' => ['except' => ''],
|
||||
'receiver' => ['except' => ''],
|
||||
'custom' => ['except' => ''],
|
||||
'groupBy' => ['except' => 'none'],
|
||||
'threshold' => ['except' => 25],
|
||||
'page' => ['except' => 1],
|
||||
'sortField' => ['except' => 'created_at'],
|
||||
'sortDirection' => ['except' => 'desc'],
|
||||
'perPage' => ['except' => ''],
|
||||
];
|
||||
|
||||
final public function mount(): void
|
||||
{
|
||||
$this->sortField = match ($this->groupBy) {
|
||||
@@ -71,7 +66,7 @@ class InviteLogSearch extends Component
|
||||
|
||||
final public function updatedPage(): void
|
||||
{
|
||||
$this->emit('paginationChanged');
|
||||
$this->dispatch('paginationChanged');
|
||||
}
|
||||
|
||||
final public function updatingGroupBy($value): void
|
||||
@@ -85,7 +80,8 @@ class InviteLogSearch extends Component
|
||||
/**
|
||||
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator<Invite>
|
||||
*/
|
||||
final public function getInvitesProperty(): \Illuminate\Contracts\Pagination\LengthAwarePaginator
|
||||
#[Computed]
|
||||
final public function invites(): \Illuminate\Contracts\Pagination\LengthAwarePaginator
|
||||
{
|
||||
return Invite::withTrashed()
|
||||
->with(['sender.group', 'receiver.group'])
|
||||
|
||||
Reference in New Issue
Block a user