Use Laravel Event/Listener system and either Echo or Pusher to broadcast the events to the front end. I’ve done what you’re describing using both the scheduler and events.
Best approach for scheduling event on post start and end date
I'm developing some kind of real-time post displaying application with Laravel, and I can't seem to find a good approach for what I need.
The end user can create posts with specific start and end date/time, and I need to notify the client (frontend) when a post should start showing, and when should stop as well (e.g., post should start 2022-05-05 10:00:00 (notify frontend at this time), end at 2022-05-05 18:00:00 (notify frontend at this time)). These notifications should be send really fast.
I know I could schedule a task using Laravel Task Scheduling that runs every X seconds and checks all the posts start/end dates and then notify, however I don't know if this is the best approach. Do you have any other suggestions or technologies I could use?
Please or to participate in this conversation.