Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 8
SmsApiController
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 8
 index
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 create
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 5
 edit
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 destroy
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
<?php
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Log;
use SmsHelper;
use App\Models\Auth\User;
use App\Models\Admin\Team;
use Carbon\Carbon;
use Auth;
class SmsApiController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {   
        
    }
   
    
    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {   
        $userId=1;
        $mobile= $post_fields["send_to"] = "8077432252";
        $message =  'Hi, Thank you for calling Vayudoot helpdesk. Our team will call back as soon as our office opens tomorrow morning.';
        $result = SmsHelper::sendSms($userId, $mobile, $message);
        return $result;
        // $curl = curl_init();
        // $post_fields = array();
        // $post_fields["method"] = "sendMessage";
        // $post_fields["send_to"] = "8077432252";
        // $post_fields["msg"] = "This is sample test message from GupShup";
        // $post_fields["msg_type"] = "TEXT";
        // $post_fields["userid"] = config('settings.SMS_USERNAME');
        // //37
        // //©Gupshup Technology India Pvt. Ltd. 2020GupShup Enterprise API Help Document
        // $post_fields["password"] =  config('settings.SMS_PASSWORD');
        // $post_fields["auth_scheme"] = "PLAIN";
        // $post_fields["format"] = "JSON";
        // //return   CURL_HTTP_VERSION_1_1;
        // //return CURLOPT_HTTP_VERSION;
        // //return $post_fields;
        // curl_setopt_array($curl, array(
        //     CURLOPT_URL => "https://enterprise.smsgupshup.com/GatewayAPI/rest",
        //     CURLOPT_RETURNTRANSFER => true,
        //     CURLOPT_ENCODING => "",
        //     CURLOPT_MAXREDIRS => 10,
        //     CURLOPT_TIMEOUT => 30,
        //     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        //     CURLOPT_CUSTOMREQUEST => "POST",
        //     CURLOPT_POSTFIELDS => $post_fields
        // ));
        // $response = curl_exec($curl);
        // $err = curl_error($curl);
        // curl_close($curl);
        // if ($err) {
        //     //echo "cURL Error #:" . $err;
        //     return response()->json([
        //         'status' =>422,
        //         'error' => "cURL Error #:" . $err
        //     ]);
        // } else {
        // //echo $response;
        //     return response()->json([
        //         'status' =>200,
        //         'response' =>  $response
        //     ]);
        // }
    }
    
    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }
    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
       
    }
   
}