Override Global Search View - Custom View

I'm trying to modify the Global Search from Filament using my custom view but I'm not achieving to do this.

I would like to use some funcs from Algolia like recent searchs among others, to be able to do this, I create a new livewire component and I would like to render on Global Search Filament place.

I found a way using
FilamentView::registerRenderHook
but I dont know how to render the Livewire Component.

Any idea ?

Livewire Component:
<?php

namespace App\Livewire;

use App\Models\Client;
use Livewire\Component;

class GlobalSearch extends Component
{
    public $search= '';
    public $results= [];

    public function render()
    {
        $this->results = Client::search($this->search)->get();
        return view('livewire.global-search');
    }
}
Solution
Ops, found a way.

FilamentView::registerRenderHook(
"panels::topbar.end",
fn (): string => Blade::render('@livewire('GlobalSearch')'),
);
Was this page helpful?