F
Filament8mo ago
myster

Problem with livewire

To use alpine, I converted my page to a component and changed the routes, etc. But I have this problem with functions that I believe are standard for filament. I have separated some examples in the links below, it is important to say that I use a blade. How could I resolve this?https://flareapp.io/share/DPyKvWD5 https://flareapp.io/share/LPlKXY2m https://flareapp.io/share/RmrKy40P
Flare
Method App\Http\Livewire\batePapo::getHeader does not exist. - The error occurred at http://127.0.0.1:8000/admin/batepapo
Flare
Method App\Http\Livewire\batePapo::getRenderHookScopes does not exist. - The error occurred at http://127.0.0.1:8000/admin/batepapo
Flare
Method App\Http\Livewire\batePapo::getCachedSubNavigation does not exist. - The error occurred at http://127.0.0.1:8000/admin/batepapo
11 Replies
Dennis Koch
Dennis Koch8mo ago
To use alpine, I converted my page to a component and changed the routes, etc.
Sorry, I don't understand that part. How is this related to Alpine and what to you mean by "converted page to component"?
myster
myster8mo ago
Sorry, I believe I expressed myself incompletely. I have a chat on filament. This chat loads messages directly from my database. However, for the chat to be 'live', a member of the support team advised me to use livewire + alpine. To do this, I have been trying to convert the static page into a livewire component so that it is possible to do what he asked me to do. Today my chat is almost entirely on blade. With some functions in app/filament/pages. My question is, how do I convert to livewire correctly, without changing my panel or even the chat that is in blade.
Dennis Koch
Dennis Koch8mo ago
Not sure how Alpine is related to Livewire components? You have a complex scenario and I have no idea what you are currently doing (code?)
myster
myster8mo ago
I've never changed a page to livewire, I believe I can even modify the blade to use alpine. But changing the page to a livewire component is proving to be the challenge!
Dennis Koch
Dennis Koch8mo ago
I've never changed a page to livewire
Filament pages ARE Livewire components
myster
myster8mo ago
🥴 So does this mean that you could always be using Alpine on the blade?
Dennis Koch
Dennis Koch8mo ago
Yeah, you should 😅 Again: You don't need Livewire to use Alpine. Even though Livewire v3 works on top of Alpine.
myster
myster8mo ago
Dan Harrin helped me these days and said: "this is not a question about filament, you're going to need to learn how to make a component with Livewire and Alpine once you have a Livewire component you can insert it into any Filament page" This started a saga of changes hahah tkss for your help
Dennis Koch
Dennis Koch8mo ago
And he is right 😅 You can nest Livewire components in other components.
myster
myster8mo ago
😅 🤯 Me again and it's almost certainly another simple question lol I decided to do a test to see the page reload automatically. I added the code below to JS:
let reloadIntervalId;

document.addEventListener('DOMContentLoaded', function() {
setInterval(function() {
Livewire.emit('reloadPage');
}, 10000);
});
let reloadIntervalId;

document.addEventListener('DOMContentLoaded', function() {
setInterval(function() {
Livewire.emit('reloadPage');
}, 10000);
});
reloadPage is a function that loads the necessary data, I already use it in: wire:click="reloadPage" With JS above it didn't work. What am I doing wrong? @Dennis Koch don't forget me hahah😅
Dennis Koch
Dennis Koch8mo ago
Livewire.emit emits an event and doesn’t call a method.