resetPage(); } public function updatingStatusFilter(): void { $this->resetPage(); } public function deleteLink(int $id, DeleteLink $action): void { $workspace = app('current_workspace'); $link = Link::where('id', $id) ->where('workspace_id', $workspace->id) ->firstOrFail(); $this->authorize('update', $workspace); $action->handle($link); $this->resetPage(); } public function render(): View { $workspace = app('current_workspace'); $links = Link::where('workspace_id', $workspace->id) ->when($this->search, fn ($q) => $q->where(function ($q) { $q->where('title', 'like', "%{$this->search}%") ->orWhere('slug', 'like', "%{$this->search}%") ->orWhere('target_url', 'like', "%{$this->search}%"); })) ->when($this->statusFilter, fn ($q) => $q->where('status', $this->statusFilter)) ->latest() ->paginate(20); return view('livewire.pages.links.index', compact('links')) ->layout('layouts.nimuli-app', ['title' => 'Links']); } }