1

I'm working on bus booking system i need to send booking details to user for example booking date, booking seats, price like that so how can i do that?

Default code for send massage :

class SmsController extends Controller
{
    public function sendSms()
    {
        $to = '+15778135468';
        $messagess = 'Hello World';
        $accountSid = config('app.twilio')['TWILIO_ACCOUNT_SID'];
        $authToken  = config('app.twilio')['TWILIO_AUTH_TOKEN'];
        $appSid     = config('app.twilio')['TWILIO_APP_SID'];
        $client = new Client($accountSid, $authToken);
        try
        {

            $client->messages->create(

                $to,
           array(

                 'from' => '+15092071880',
                 'body' => $messagess

             )
         );
   }
        catch (Exception $e)
        {
            echo "Error: " . $e->getMessage();
        }
    }
}

I tried like this :

class SmsController extends Controller
{
    public function sendSms()
    {
        $to = '+15778135468';
        $messagess =  $schedule->routes_id;
        $messagess1 = $request->buses_id;
        $messagess2 = $request->schedules_id;
        $messagess4 = $request->seat;
        $accountSid = config('app.twilio')['TWILIO_ACCOUNT_SID'];
        $authToken  = config('app.twilio')['TWILIO_AUTH_TOKEN'];
        $appSid     = config('app.twilio')['TWILIO_APP_SID'];
        $client = new Client($accountSid, $authToken);
        try
        {

            $client->messages->create(

                $to,
           array(

                 'from' => '+15092071880',
                 'body' => $messagess,$messagess1,$messagess2,$messagess3,$messagess4

             )
         );
   }
        catch (Exception $e)
        {
            echo "Error: " . $e->getMessage();
        }
    }
}

Also like this :

'body' => $messagess,
'body' => $messagess1,
'body' => $messagess2,
'body' => $messagess3,
'body' => $messagess4

Expect results :

Route detail ex. US to UK
Bus details ex. Sky bus
Date ex.2019/04/22
Seat no ex.A1

but no use so please help me to find out. Thank you

thush
  • 117
  • 9
  • 2
    Possible duplicate of [How to combine two strings together in PHP?](https://stackoverflow.com/questions/8336858/how-to-combine-two-strings-together-in-php) – miken32 Apr 21 '19 at 17:41

0 Answers0