How the code looks like (the entire OneSignal part, starting in the comment on line 348):
/* OneSignal Push Notification to Store Owner */
if ($newOrder->orderstatus_id == '1' && config('appSettings.oneSignalAppId') != null && config('appSettings.oneSignalRestApiKey') != null) {
$this->sendPushNotificationStoreOwner($restaurant_id, $unique_order_id);
/* START SEND WHATSAPP WITH API TO OWNER AFTER ORDER PLACED*/
//The URL with parameters / query string.
$url = 'https://api.callmebot.com/whatsapp.php?phone=+444444&text=xx+xx+xx+xx+xx+xx&apikey=xxxxx';
//Once again, we use file_get_contents to GET the URL in question.
$contents = file_get_contents($url);
/* END SEND WHATSAPP WITH API TO OWNER AFTER ORDER PLACED*/
}
/* END OneSignal Push Notification to Store Owner
*/``
And this are the conditions for the code to be triggered:
if ($newOrder->orderstatus_id == '1' && config('appSettings.oneSignalAppId') != null && config('appSettings.oneSignalRestApiKey') != null)
As i said before; it is up to you to put it elsewhere; i just think that sending push notifications via OneSignal AND whatsapp notification using the API is the way to go..