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

Matt Stauffer:
Environment specific variables in Laravel's testing environment
Nov 06, 2015 @ 10:43:09

Matt Stauffer has a quick post to his site showing how you can set up and use environment specific variables in Laravel, specifically for your testing environment.

In Laravel, it's easy to set environment variables that are specific to your testing environment. Just edit your phpunit.xml file and set them as entries in the block [...] but what if you find yourself needing to exclude these values from version control?

He talks about the project he's working on and its integration with Twilio. He need to write some tests for a class that connected to the Twilio service but wanted an easy way to swap out the production credentials with the Twilio test ones. Instead of checking in the test credentials, he dropped them into his .env settings file, one specific to the test environment.

tagged: environment variable laravel testing twilio credentials.

Link: https://mattstauffer.co/blog/environment-specific-variables-in-laravels-testing-environment

Twilio Blog:
How to Build a Digital Decoder Ring Using PHP, FilePreviews.io and Twilio MMS
Oct 08, 2014 @ 13:25:30

The Twilio blog has an interesting post that lets you "tap into your inner spy" and shows you how to use their service to build a "digital decoder ring" that decodes text based on a Caesar cipher and revert it back from its encoded state, texting the results back to the user.

If you are like me you’ve probably always wanted to tap into your inner Sydney Bristow [from Alias] and become a kick-ass CIA spy. Today I’m going to show you how to use PHP, FilePreviews.io and Twilio MMS to come one step closer to that dream. We’re going to build an app that lets you snap a picture of a Caesar ciphered text, send it to a phone number and get a response with the decoded text. I

He starts with a list of things you'll need (including accounts on Twilio and FilePreviews.io) and the Twilio PHP SDK. The remainder of the post walks you through the code and pieces you'll need to make it all work:

  • Analyzing Our Image
  • Receiving Images Via MMS
  • Cracking the Code

The end result will send the decoded information back to the caller using the rickyrobinett/CaesarCipher library sent through the Twilio service. You can get the full, working code for the example on Ricky Robinett's GitHub account.

tagged: twilio decoderring filepreviewio caesar cypher tutorial mms

Link: https://www.twilio.com/blog/2014/10/how-to-build-a-digital-decoder-ring-using-php-filepreviews-io-and-twilio-mms.html

Twilio Blog:
How to Build an MMS Ticketing System Using PHP, Laravel and Twilio
Oct 03, 2014 @ 12:18:54

On the Twilio blog there's a recent post showing the construction of some fundamental parts of a MMS ticketing system using Laravel and Twilio for the messaging.

Have you ever arrived at a movie, flight or concert and realized you’ve forgotten your paper ticket? Imagine how much worse it would be if you showed up at Willy Wonka’s front door, but forgot your golden ticket! To prevent an epic disaster such as this, we’re going to build an app that delivers Willy Wonka’s golden ticket directly to your phone using MMS. All the Oompa Loompas have to do is scan it. Not Willy Wonka? Don’t worry, this code should be useful for any app or company that distributes tickets. Hopefully computers are more helpful with the golden ticket than last time.

The application makes use of a few libraries outside of the Laravel framework structure to handle the various functional pieces: one for creating QR codes and another for sending the messages via Twilio. They walk through some of the basic setup for the first endpoint and the "Golden Ticket Distribution" page. He then uses the Endroid QR code library to generate a code based on a string and outputting it to the user. Using a few pieces of data from the URL (in $_GET), they define the phone number to send to and the name of the user. Finally they tie it into the Twilio messaging system and send the MMS message containing the resulting QR code.

tagged: twilio mms messaging qr code library tutorial laravel

Link: https://www.twilio.com/blog/2014/09/how-to-build-an-mms-ticketing-system-using-php-laravel-and-twilio.html

Creating a Photo Tag Wall With Twilio Picture Messaging & PHP
Jan 10, 2014 @ 10:36:00

On NetTuts.com today there's a new tutorial that helps you create a "photo tag wall" using the Twilio picture messaging functionality and some PHP. The picture messaging service lets you send and receive photos over phone numbers and short codes.

Twilio’s recently announced Picture Messaging has vastly opened up what we can do with text messaging, now we can attach photos to our text messages and have them get used in different ways. In our case, we are going to build a Photo Tag Wall, which will contain photos linked to tags that will be displayed on a website. This can be handy for events, or parties, or just about anything where you want to associate photos and tags.

They use a combination of the Jolt microframework for the structure of the app, Idiorm/Paris for the MySQL handling and the Twilio PHP library to talk to their web service. They start by setting up the database tables for both the "tag" and "photo" (SQL included). They include a sample configuration file, used by the Twilio library, and get into the actual code. The first part shows how to make the request to the API and resize the fetched data into a correctly sized photo on the server. Then they get into the routing, making both a root path and a "listener" for the Twilio API to call when a new photo it sent. Finally, they set up the actual photo wall page, pulling the image data from the database and the image from the local file system.

tagged: photo tag wall tutorial twilio picture messaging mysql

Link: http://net.tutsplus.com/tutorials/php/creating-a-photo-tag-wall-with-twilio-picture-messaging-php

Google Developer Blog:
Getting started with Twilio on Google App Engine for PHP
Aug 06, 2013 @ 11:55:51

On the Google Developers Blog there's a new post from Keith Casey showing you how to get started with Twilio on a Google App engine, PHP-based application. It requires the use of the latest Twilio helper library, so be sure to upgrade.

I’ve wanted to explore Google App Engine for years. Between its SLA, automatic scaling, and queuing system, it has always been compelling. Unfortunately, since my Python skills are somewhere between “Hello World” and “OMG What did I just do!?” I decided to save myself the embarrassment. When Google announced PHP support for App Engine, I was both ecstatic and intrigued about what might be possible. To get something running in just a few minutes, I decided to use our Twilio PHP helper.

He walks you through the full process - setting up an App Engine account and instance, using the a href="http://www.twilio.com/docs/libraries">helper library and how you'll need to configure your routing for the files in your application.

tagged: google appengine twilio helper tutorial routing

Link: http://googledevelopers.blogspot.com/2013/08/getting-started-with-twilio-on-google.html

Engine Yard:
Cloud Out Loud - PHP Evangelism at Twilio, TwilioCon (Keith Casey)
Oct 16, 2012 @ 08:52:06

In the latest episode of their "Cloud Out Loud" podcast series, Elizabeth NAramore of Engine Yard interviews Keith Casey about his role as an evangelist at Twilio.

They talk some about working at Twilio and Keith's role there, some about the Austin (Texas) technology scene that he participates in and a bit about the currently-happening TwilioCon that's running in San Francisco. There's also a mention of a conference that Elizabeth is involved in that's happening in November in Indianapolis, CodeConnexx (put on by the PHP Women group).

You can listen to this latest episode either through the in-page player or by downloading the mp3. If you'd like this and more great episodes, think about subscribing to their feed.

tagged: keithcasey twilio twiliocon12 evangelism interview engineyard


Multi-Factor Authentication with PHP and Twilio
Jun 22, 2012 @ 14:55:48

In this new tutorial on PHPMaster.com, Timothy Boronczk looks at using the Twilio API and multi-factor authentication.

You can make and receive phone calls and send and receive text messages using TwiML (Twilio Markup Language) and their REST API. You can work directly with the API, or use one of the available helper libraries. The library I’m using is twilio-php, which is the library released and officially supported by Twilio.

He shows you how to use the Twilio API library to create a connection object to their REST API and perform various actions like sending an SMS and placing a phone call. the code to built the multi-factor authentication is also included - a user login/password is checked against a database and a form is displayed (depending on if they want to voice call or SMS).

tagged: authentication twilio api rest library service


Voices of the ElePHPant Podcast:
Interview with Keith Casey
May 08, 2012 @ 13:22:54

The Voices of the ElePHPant podcast has released their latest episode, an interview with Keith Casey, a developer evangelist at Twilio.

Cal's "three questions" for Keith revolve around his work with REST and how it relates to the Twilio API:

  • What new technology do you see up and coming that will effect PHP developers the most?
  • What's the most important part of REST that PHP or other developers aren't getting?
  • What's one feature that developers don't know enough about in the Twilio API that you think they should?
  • Bonus Question: Some information about HubAustin

You can listen to this latest episode either via the in-page player, by downloading the mp3 directly or by subscribing to their feed.

tagged: voicesoftheelephpant podcast interview community keithcasey twilio


Justin Carmony's Blog:
SMS Nagios Notifications with PHP & Twilio
Jan 31, 2012 @ 12:40:46

In this latest post to his blog Justin Carmony looks at a system he created to hook his Nagios notifications into the Twilio web service and have it notify him via SMS with something was wrong.

In the past I would just use my iPhone's email-to-txt email address. However, when I received the txt message, it wasn't formated very pretty, and it would have a different "From Number." So if we had a crazy day, I would have 20-30 message threads in my iPhone all about Nagios. [...] What I like out this setup is with Twilio, I can buy a phone number for $1 a month. So all my notifications come through the same number.

He's included the PHP code he uses to send the notifications (using the Twillo library) and the Nagios commands he configured to send the notifications to that script via the command line.

tagged: sms nagios tutorial twilio notifications commandline