I'm developing a gym website using Angular 6 with service workers that needs to send notifications to users (Web push notifications) when the class they are subscribed to is going to begin (for example 15 minutes before the start time).
By the time I have a PHP function that uses Minishlink\WebPush to send the notification, so I need to call that function 15 minutes before the class starts, and it has to be done automatically because there's no interaction of the user in order to call that function.
I've thought about having a MySQL event that consults the table where classes are stored, and when the time has arrived calls that PHP function but I don't know how to do it, and even if it is the best idea.
Any suggestions?
I'm using Angular 6 + PHP + MySQL running locally on XAMPP.