<?php


namespace App\Repositories;


use App\Notifications\FreeSiteNotification;
use NotificationChannels\OneSignal\OneSignalMessage;
use OneSignal;

class NotificationRepository {

    public static function sendNotification($params) {
        $title = $params['title'];
        $user_id = $params['user_id'];

        if ($user_id!=null) {
            \OneSignal::sendNotificationToUser(
                $title,
                UserRepository::find(81)->one_signal_player_id
            );
        } else {
            \OneSignal::sendNotificationToAll(
                $title
            );
        }

    }
}
