Probably a cache issue, try like this it should do the rest automatically by global $this->dispatch('lead-assigned'); if still not works then try resetting your pagination
Apr 8, 2026
3
Level 2
Problem with dispatch on parent component
Hi,
I've a component (lead-not-assigned.blade.php)
<?php
use App\Enums\DossierCaseEnum;
use App\Models\DossierModel;
use Livewire\Attributes\Computed;
use Livewire\Attributes\Layout;
use Livewire\Attributes\On;
use Livewire\Attributes\Title;
use Livewire\Component;
new
#[Layout('layouts::admin.app'), Title('Lead not assigned')]
class extends Component {
use \Livewire\WithPagination;
#[Computed]
#[On('lead-assigned')]
public function dossiers()
{
return DossierModel::query()
->where('case', DossierCaseEnum::NOT_ASSIGNED_LEAD)
->orderBy('created_at', 'ASC')
->paginate(15);
}
};
?>
<div class="max-w-7xl h-full">
<div class="flex items-center justify-between">
<div>
<flux:heading size="xl">Leads not assigned</flux:heading>
<flux:text class="mt-2">Manage your not assigned leads</flux:text>
</div>
</div>
<div class="grid grid-cols-2 gap-6 mt-8">
@foreach($this->dossiers as $dossier)
<livewire:pages::admin.leads.lead-not-assigned-card :$dossier
:wire:key="$dossier->id"
:lazy.bundle="$dossier->iteration > 9"
/>
@endforeach
</div>
</div>
And his child component (lead-not-assigned-card.blade.php) :
<?php
use App\Actions\Dossier\AttachInitialStatusAction;
use App\Enums\DossierCaseEnum;
use App\Models\AgencyModel;
use App\Models\DossierModel;
use App\Models\User;
use Livewire\Attributes\Computed;
use Livewire\Attributes\Lazy;
use Livewire\Component;
new
#[Lazy]
class extends Component {
public DossierModel $dossier;
public ?string $analyst = null;
#[Computed]
public function financingAmount()
{
return $this->dossier->getTotalLoansAttribute()
+ $this->dossier->getTotalOverdraftsAttribute()
+ $this->dossier->getTotalTreasuriesAttribute()
+ $this->dossier->getTotalDebtsAttribute();
}
#[Computed]
public function analysts()
{
$agency_id = AgencyModel::where('is_main', true)->first()?->id;
return User::whereHas('agencies', function ($query) use ($agency_id) {
$query
->whereIn('agency.id', [$agency_id]);
})->orderBy('name', 'ASC')
->get();
}
public function transfer()
{
$this->validate([
'analyst' => ['required', 'exists:users,id']
], [
'analyst.required' => 'Analyst is required.',
'analyst.exists' => 'Analyst is not valid.'
]);
try {
$user = User::find($this->analyst);
$this->dossier->sale_agent = $user->id;
$this->dossier->case = DossierCaseEnum::DISCOVER_DOSSIER;
$this->dossier->save();
$this->dossier->refresh();
$agencies = $user->agencies();
if (0 === $agencies->count()) {
throw new Exception('User has no agency.', 500);
}
AttachInitialStatusAction::execute($this->dossier, $this->dossier->case);
$this->dossier->agency()->associate($agencies->first());
$this->dossier->analysts()->attach($user);
$this->reset(['analyst']);
$this->dispatch('lead-assigned')->to('lead-not-assigned');
} catch (\Exception $e) {
}
}
};
?>
@placeholder
<flux:skeleton class="min-h-56 rounded-lg" animate="shimmer" />
@endplaceholder
<div class="border-2 rounded-md p-4 space-y-4">
<div class="flex items-center justify-between">
<flux:badge size="sm">{{ $dossier->updated_at->translatedFormat('d F Y H:i') }}</flux:badge>
<div>
<flux:badge size="sm">{{ $dossier->dossierBorrowers->first()->typeHousingStatus->name }}</flux:badge>
<flux:badge
size="sm">{{ $dossier->dossierJobs->first()->typeJobContract?->short_name ?? $dossier->dossierJobs->first()->typeJobContract?->name ?? 'N.C' }}</flux:badge>
</div>
</div>
<flux:separator />
<div class="space-y-2">
<flux:heading>Financing amount
: {{ Number::currency($this->financingAmount(), in: 'EUR', locale: 'fr') }}</flux:heading>
<flux:text>Total loans : {{ Number::currency($dossier->getTotalLoansAttribute(), in: 'EUR', locale: 'fr') }}
-- {{ Number::currency($dossier->getTotalLoansMonthlyPaymentAttribute(), in: 'EUR', locale: 'fr') }} / mois
</flux:text>
<flux:text>Total Treasuries
: {{ Number::currency($dossier->getTotalTreasuriesAttribute(), in: 'EUR', locale: 'fr') }}</flux:text>
<flux:text>Total Resources
: {{ Number::currency($dossier->getTotalResourcesAttribute(), in: 'EUR', locale: 'fr') }}</flux:text>
</div>
<div>
<div class="flex items-center gap-2">
<flux:text variant="strong">Quick transfer</flux:text>
<flux:field>
<flux:select variant="listbox" placeholder="Choose analyst..." wire:model="analyst">
@foreach($this->analysts as $analyst)
<flux:select.option value="{{ $analyst->id }}">{{ $analyst->full_name }}</flux:select.option>
@endforeach
</flux:select>
</flux:field>
<flux:button variant="primary" icon="arrow-path-rounded-square" wire:click.prevent.stop="transfer">
Transfer
</flux:button>
</div>
<flux:error name="analyst" />
</div>
</div>
But dispatch does not work ! dossiers method in parent component always display lead whereas it's not an not assigned lead anymore. Anyone has an idea ?
Please or to participate in this conversation.