How to Send an SMS with Mezzio PHP Framework
Whether we’re voting for our favorite candidate on shows such as X Factor, or receiving two-factor authentication codes to log in to services like MailChimp and GitLab, SMS are virtually ubiquitous in modern life. Not only do they make communication in life and work much easier, it also doesn’t take a lot of code to send them either.
Once completed, you will be able to send a POST request to the API’s default endpoint, supplying the phone number to send the message to, and the message to send. If the message was successfully sent, then a JSON response will be returned showing a number of details about the sent SMS. If the SMS was not able to be sent, then an appropriate JSON response will …
Build an Urban Dictionary Chatbot in PHP with Bref and the Twilio API for WhatsApp
Internet slang evolves so rapidly that it’s easy to get lost in communication while texting without the help of linguistic services like Urban Dictionary. Wouldn’t it be great if you could easily query new colloquialisms on the go?
In this tutorial, we will build a handy WhatsApp bot that gives us the Urban Dictionary definition of words. It will leverage the Twilio API for WhatsApp and the Urban Dictionary API to find and provide the definitions we need, on demand.
In order to follow along with this tutorial, you will need the following:
- PHP (version 7.2 or higher to use the latest version of Bref)
- Composer, npm, and the Serverless CLI installed
- A Twilio Account
- ngrok installed (to use your local server as a webhook URL)
If you are using a UNIX or Mac OS system, create and enter into the project folder …
Retrieving Phone Number Pricing for Twilio Programmable Voice using Laravel
The foremost issue when building solutions with third-party services is estimating the cost implications of consuming the API. This tutorial is a guide through the process of understanding the costs of Twilio’s phone number services using a Laravel application.
To begin with a Laravel project, all relevant modules required for proper functionality need to be installed. The modules are:
Having installed Laravel on your machine, proceed to create a new project using the Laravel CLI:
$ laravel new project_name
Or using the Composer create-project command:
$ composer create-project --prefer-dist laravel/l …
Build a Two-way Customer Support System with SMS and Slack using Symfony Notifier
Businesses across the internet interact with millions of customers every day. Providing customers with a positive experience helps to build a strong brand image and increases their trust. Reliable, fast, and helpful customer support is a key component of great customer service and it all starts by providing a convenient and simple way to get in touch. Just as crucial is the need to provide your customer support team with the tools they need to assist your customers.
In doing so, you’ll see the Symfony Notifier Component in action and understand how to leverage it’s abstraction to communicate between the customer and your support staff through different communication channels. Finally, we’ll look at how to react to incoming …
Automate a Confirmation Call in PHP with Programmable Voice and Autopilot
I recently had a dentist appointment. Two days before the appointment, I received a call from my dentist’s assistant, confirming if I was still available for the booking at the arranged time.
While that was nice, I thought there would be an easier way to do it. It would be nice if this process could be automated and have assistants handle more complicated situations. In this tutorial we are going to work on a PHP application that automates this process using Twilio Programmable Voice and Autopilot.
This tutorial will require the following:
Handling Cross-Origin Resource Sharing (CORS) Requests in Laravel 7
By default, browsers implement a same-origin policy that prevents scripts from making HTTP requests across different domains. Cross-Origin Resource Sharing (CORS for short) provides a mechanism through which browsers and server-side applications can agree on requests that are allowed or restricted.
In this tutorial, we'll be building a simple Vue.js app powered by Laravel to learn about CORS. We will take a deep-dive into the various configuration options needed by Laravel to handle CORS OPTIONS requests and see how some of these options affect our application.
In order to complete this tutorial, you will need the following:
- Familiarity with the Laravel framework
- An existing project with Laravel framework version >= 7.0.
- Vue CLI installed.
Create a new folder to hold both the Laravel API and the Vue project, and create …
Build a GraphQL Powered API with Laravel
Often referred to as a platform or programming language agnostic query language, GraphQL is a comprehensive approach to guide software engineers in building data-driven applications. It is, in my opinion, the new API standard, offering client applications the flexibility to request exact data and not an entire record from the database. If you are not yet conversant with this technology or looking for simplified technical content to guide you through, you are in the right place.
In this tutorial, you will learn some of the fundamental concepts required to build a Laravel API powered by GraphQL. This is a shift from the conventional architecture of building REST APIs, as we will take a different approach in this tutorial. To help us explore GraphQL, we will build a bookstore API with an ability to carry out CRUD ( Create, Read, Update, Delete ) operations on data, in your database.
Create a WordPress Plugin to Rebuild Your Gatsby App on AWS using GitHub Actions
For a while, our content editors at Postman had to log into GitHub and rebuild the Gatsby app every time they made a change or published a new blog post to the company’s WordPress. As you can imagine, this became very time consuming and wasn’t the most efficient use of our team’s time.
To remedy this, I decided to sit down and write a PHP plugin for our WordPress Admin Dashboard, in order to enable our content writers to re-publish their changes from within our headless CMS.
We used WPGraphQL to create a GraphQL layer from our WordPress content and query our data via the gatsby-source-graphql plugin to our Gatsby App. The resulting solution allowed our blog to be more secure, faster, and future proof.
The plugin creates Nodes in Gatsby to turn the WordPress Data into pages. This results in the App updating its content at build time. If …
Create a Real-Time Twitter Stream in PHP using Pusher and Laravel
Laravel is one of the most famous PHP MVC frameworks, largely due to its commitment to modern architecture and active community. Laravel 7, the latest release, has added the coolest new features like Blade-X, Stubs, Cache optimization, and much more.
Pusher is the hosted service that enables developers to add real time data and functionality easily and securely by taking care of all the heavy lifting under the hood.
Laravel supports Pusher integration very gracefully, which makes it very easy for developers to add real-time functionality to their application. In this tutorial, we will be using Twitter APIs to fetch tweets based on a specific hashtag, and create a dashboard to display them in real-time using Pusher.
How does Pusher work?
Process Incoming Emails with Laravel and SendGrid Inbound Parse
Sending emails from your Laravel app is a common requirement, but sometimes, you want to receive and process the replies programmatically as well. SendGrid lets you process inbound emails with Inbound Parse. Inbound Parse allows you to provide a webhook URL to process all incoming emails for a domain or subdomain. Subdomains are recommended as they don’t affect your regular domain emails.
In this tutorial, we will be building a blog application where users can comment on a post by replying to a transaction email.
To complete this tutorial, you will need:
- Composer and the Laravel installer on your machine.
- An authenticated domain on SendGrid. You can follow the guide here to set one up.
- Ngrok installed (for creating a tunnel on your localhost)
Create Migrations and Models
To get started, create a new Laravel project in your preferred location (I am naming mine
sg-inbound), switch to …