Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jason McCreary:
SMS admin in 8 lines of code
Sep 21, 2017 @ 09:45:06

In a new post to his site Jason McCreary shows how he integrated SMS for account administration for the Laravel Shift service. It's his method of providing good support for the project from anywhere, even when he's away from his machine.

In the end, all I need is a quick way to run a Shift on the go. Looking back on almost two years of support, I often have the Shift number readily available. Creating the job and adding it to the queue is at most two lines of code. So the steps are not the pain point.

The pain point is connecting to the server. [...] What do I carry around with me all the time? My phone. I’m already reviewing the support emails from my phone. Wouldn’t it be great when I need to run a Shift manually to just reply or send a text.

He then shares the code he used to create the administration interface via SMS through the Nexmo service. He uses the information the Nexmo service sends to hiswebhook via a special number and handles it via a special endpoint on his side. In this case the interface allows him to re-run a "shift" that was previously requested if there was an error. The code is pretty simple, made up of a controller and route for the endpoint and a "FormRequest" class for the message processing.

tagged: sms administration laravel shift example nexmo

Link: https://jason.pureconcepts.net/2017/09/nexmo-sms-admin-laravel/