It seems that the wire:poll directive is not firing in your Livewire component. Here are a few things you can check to resolve the issue:
- Make sure you have included the Livewire JavaScript library in your layout file. Add the following code just before the closing
</body>tag in yourlayouts/app.blade.phpfile:
@livewireScripts
- Ensure that you have installed the Livewire package and its dependencies correctly. Run the following command in your terminal:
composer require livewire/livewire
- Check if the Livewire JavaScript assets are being loaded correctly. Inspect the page source and verify that the following script tags are present:
<script src="{{ mix('js/app.js') }}"></script>
@livewireScripts
- Verify that you have included the Livewire CSS assets in your layout file. Add the following code within the
<head>section of yourlayouts/app.blade.phpfile:
@livewireStyles
- Make sure you have started the Livewire polling feature. In your
TestPagecomponent, add thepollmethod to themountlifecycle hook:
public function mount()
{
$this->poll();
}
- Check if there are any JavaScript errors in the browser console. Open the developer tools in your browser and look for any error messages related to Livewire.
If the issue persists, please provide more information about your Laravel and Livewire versions, as well as any error messages you encounter.