sidrit
sidrit
FFilament
Created by sidrit on 3/22/2024 in #❓┊help
Redirect on HTTP Client exception
4 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
It’s a good point. The WS integration on my end is still on the exploratory phase. There will be some things that need an open WS channel no matter what, some that are fine with -some level- of polling and some other ones with a hybrid approach : subscription on a page level and rehydrate only when needed
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
Have a good rest of the evening man and thatnk you for your help
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
Yea i think i imagined the setListeners() method. These will have to be custom components 🙂 But no way i'm deaing with this tonight.
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
So what i'm trying to do now, before i take the custom TextColumn route is figure out a way to access the $livewire instance for a TextColum while in the table() method. Livewire has a setListeners() method that can be called, well, to register listeners.
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
Here's the idea. Let's imagine an uptime checker or something. You have a list of sites. Either in a table or Infolist. For each one of thse let's stay you have a status item. There is a schedule in the system that periodically fires checks for uptime. When you're looking at the sites list, after the check is done, we update the status with some information. The idea is to get each one of these sites to subscribe to their own channel and listen to their own events.
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
Not sure i understand the question. This broadcast message i was using (and likely the one i will be setting up) will carry over a DTO or just a POPO. It will be on a private channel non the less and likely will need to go through policies
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
Tomorrow i'm going to figure out how to actually get the listening done on a TextEntry or TextColumn level. This listener here was just to check the piping. But it guess since those are Livewire components as well i'm either going to have to somehow set the listener (i think here is a setListeners() method) when i set up the TextEntry/TextColumn on the injected $livewire or go ahead and define a custom TextEntry/TextColumn and add listening capabilities to those
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
The syntax is a bit different. For private channels it's "echo-private:App.Models.User." . auth()->id() . ",GlobalCheckCompletedEvent" => 'handleGlobalCheckCompleted' instead of "echo:App.Models.User." . auth()->id() . ",GlobalCheckCompletedEvent" => 'handleGlobalCheckCompleted'
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
I should stop doing these things at 3am
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
Holy shit i got it
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
I think more than laravel it might be livewire. https://livewire.laravel.com/docs/events#real-time-events-using-laravel-echo. I've used echo and Livewire a number of times before and this has been the m.o. since it appeared as a feature in 2.x
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
No description
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
Huh.
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
That's the point. The listener is not firing.
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
The getListeners() method of the component is getting called. But the handler for the given event is not.
protected function getListeners(): array
{
return [
"echo:App.Models.User." . auth()->id() . ",GlobalCheckCompletedEvent" => 'handleGlobalCheckCompleted',
];
}
protected function getListeners(): array
{
return [
"echo:App.Models.User." . auth()->id() . ",GlobalCheckCompletedEvent" => 'handleGlobalCheckCompleted',
];
}
So i know that GlobalCheckCompletedEvent is getting fired in the system but although the listener is registered, the handler handleGlobalCheckCompleted is never getting called. So either my syntax is wrong, i'm missing something, or GlobalCheckCompletedEvent is not making it in this component.
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
That's clear and fine. I've got the listener set up in a ViewRecord type page, in this case View site. I know that Livewire getListeners is getting called. I can dd in it.
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
The event is fired. I can see it in the queue. I can see it in the reverb debug window and i can even listen for it (outsite of filament in a plain blade file) by subscribing via javascript. The Livewire listener is set up (via getListeners) but the handler (method called handleGlobalCheckCompleted is not invoked).
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
technically speaking i don't even need echo.js (the project is all Filament) so setting up the listeners should be all that is needed (echo.js was set up just as a sanity check).
40 replies
FFilament
Created by sidrit on 3/16/2024 in #❓┊help
Listening for broadcast events
The problem is i'm not getting anything on the filament side 😩 and i know that getListeners method is getting called
40 replies