<?php

namespace App\Http\Controllers\Services;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Services\serviceBulkSMSbdController;

class smsGatewayController extends Controller
{
    public static function sendSms($phone, $message)
    {
        if(setting('sms_config_status') == 1){
            
            $response = ['status' => false, 'message' => 'No SMS service was successful.'];

            if(setting('STATUS_BULKSMSBD') == 1){
                $response = serviceBulkSMSbdController::sendSms($phone, $message);
                if($response['status'] === true) {
                    return $response;
                }
            }

            if(setting('STATUS_PRIME_SOFT_SMS') == 1){
                $response = servicePrimeSmsController::send($phone, $message);
                if($response['status'] === true) {
                    return $response;
                }
            }

            return $response;

        } else {
            return [
                'status' => false,
                'message' => 'Any SMS service is not activated.'
            ];
        }
    }
}
