Hi, I already have the code that performs push notifications with nodejs, tested in my apps. I recommend you reuse it, I can also translate it to php if it is a requirement.
I can deliver it to you in just two days with support for sending notifications and data, complying with the firebase standard and using ttl and collapse properties to optimize the delivery of notifications and offer a better user experience.