Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

589
Views
How to refresh livewire component on difference Route or Page?

i have 2 livewire component on difference route :

route : ../find/add

class Preview extends Component
{

    public $rabId;

    public function render()
    {
        $rab = Rab::find($this->rabId);

        return view('livewire.rab.preview', [
            'rab' => $rab,
        ]);
    }


    public function sendFinanceData(int $rabId)
    {
    
        $rab = Rab::find($rabId);

        ModelRabStatus::updateOrCreate([
            'rab_id' => $rabId,
        ], [
            'status' => RabStatus::Pending,
        ]);

        $this->emit('sendRabToFinance');
    }

}

and route : ../fin/list

class Index extends Component
{
    protected $listeners = [
        'sendRabToFinance' => '$refresh',
    ];

    public function render()
    {

        $pending = ModelRabStatus::whereStatus(RabStatus::Pending)->orderBy('created_at', 'asc')->paginate(10);

        $approved = ModelRabStatus::whereStatus(RabStatus::Approved)->orderBy('updated_at', 'desc')->paginate(10);

        return view('livewire.finance.f-rab.index', [
            'pending' => $pending,
            'approved' => $approved,
        ]);
}

}

i want to refresh Index component when i click wire:click="sendFinanceData{{$id}}" but it doesn't work using magic $refresh. Any reference how to refresh the component on a different route or page?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!