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 …
A major factor to consider when building web applications is evaluating the cost of integrating third-party services. If you’re using Twilio, this tutorial will serve as a guide to finding the cost of making SMS/Messaging requests to the Twilio Programmable SMS APIs.
To get started with this tutorial, you will need to have the following modules/packages installed on your development machine:
Here is a guide that can be followed to install Composer globally:
Creating the PHP Project
First, create a folder named
smsPricing on your local machine where the code will be housed.
In the folder that was created, create a file named index.php which will contain all the code for this tutorial.
Now, let’s go ahead and install Twilio's PHP SDK in order to call the necessary APIs required to share the functions. To accomplish …
There are different methods of converting bitcoins to local currency and vice versa such as blockchain exchange sites and wallet apps, Today, this tutorial will walk you through creating your simple Bitcoin converter using SMS and PHP, allowing you to check current market rates on the go!
To complete this tutorial, you will need the following dependencies globally installed on your computer:
PHP 7 development environment
- Global installation of Composer
- Twilio Account
- Cryptocompare API
- Global installation of ngrok
Set Up Your Development Environment
To kick start our project, we will need to create a project directory for it. You may use
cryptoconverter as this is what I will be using. Create the following files in the project folder:
Next, we need to set up our
.env file is a hidden file used to store secret and private keys on our servers. …
Bref is a composer package that helps you deploy your PHP applications as AWS Lambda functions. It leverages the Serverless Framework to provision and deploy such applications, and provides support for common frameworks like Laravel, Symfony, and Slim PHP.
In a previous article, we explored how we can use the Bref PHP framework to forward errors from our Twilio application to a Slack channel. In this article, we will revisit Bref by building a service that verifies users’ phone numbers using the Twilio Verify API.
To complete this tutorial, you will need:
- Composer and npm installed on your computer.
- A Twilio Account
- A root AWS Account (to create an IAM user)
- cURL or Postman installed to test our application endpoints
- The Serverless CLI
Create a Twilio Verify Service
To get started, head over to your Twilio Verify Console and create a new Verify Service. Take …
Since Laravel version 5.1, as developers have been given the ability to
cast attributes on models. Attribute casting provides a convenient method of converting attributes to common data types. Behind the scenes, Laravel actually uses these casts for the
updated_at fields on a typical model. These attributes are cast as a
datetime which converts the database timestamp to a Carbon instance. The cast types that we have had at our disposal are
However, with the release of Laravel 7, we have the ability to create our own custom
cast types. For example, maybe you have a model that stores the price of a product or subscription as cents along with currency. We can now create a custom cast that will handle storing …
As the Coronavirus continues to exponentially spread across the globe, software developers around the world are doing the best they can to ensure the distribution of secured and trusted information concerning the Novel Coronavirus. For instance, numerous open-source API projects have been started to provide data to track the number of infected people, recovery rate, and unfortunately, the number of deaths recorded in different countries.
Commonly, to stay up-to-date with the statistics in your country or neighboring countries requires a browser and surfing the internet to get what is sometimes accurate information.
In this post, I will show you how to explore one of the recently published open-source APIs built to share the global data. During this process, we will build a WhatsApp chatbot that gives a summary of confirmed and recovered cases and the number of deaths recorded, respectively, by leveraging the infrastructure made available by the …
According to the Alpine.js docs, its syntax is almost entirely borrowed from Vue.js (and by extension Angular.js), so if you already know either of these frameworks there is a very low learning curve to getting started.
Before you begin this tutorial, make sure you have the following set up/installed:
NOTE: We are leveraging the power of Laravel Livewire for this demo, …
Over the years, we’ve seen a steady increase in the number of bots and chatbots available to us over different platforms. Brands make use of bots as an exciting way to engage customers, while also providing a way to automate what could normally be considered, monotonous conversations. With it’s over 1.5 billion users and growing, and familiar chat technology, WhatsApp presents a strong case for building a chatbot on it’s platform.
In this tutorial, we’ll be looking at how we can build a WhatsApp Currency Conversion Bot for converting multiple currencies using the Twilio API for WhatsApp.
You will need the following to complete this tutorial:
- PHP version 7.2.5 or Higher
- Laravel 7
- Twilio Account
- An API Key From Currency Converter
Setting up Laravel
There are different ways to set up a new Laravel project. You can do so via the Laravel installer or by …
Performing unit, automated feature, and API endpoint testings are considered as some of the best practices to ensure proper implementation of specified software requirements, because they help guarantee the success of such applications. Testing, by all means, tends to give you a 100 percent assurance that any incremental changes and newly implemented features in your project won’t break the app. This practice is often referred to as Test-driven Development.
Laravel, as one of the popular PHP frameworks was built with testing in mind and comes with a testing suite named PHPUnit. PHPUnit is a testing framework built to enhance PHP developers’ productivity during development. It is primarily designed for testing PHP code in the smallest possible components known as unit testing, but also flexible enough to be used beyond unit testing.
In this tutorial, we will take a test-driven development approach and learn how to test the endpoints of …
Team TwilioQuest is thrilled to announce our newest mission, the OSS Elephpant! This mission introduces players to local development with PHP through a series of fun challenges. Playing through this mission, you will learn fundamental skills with this popular server-side programming language. You can download and play TwilioQuest right now to try it out!
A new mission
Board the OSS Elephpant, a massive living colony ship whose slumbering passengers need your help! A series of mysterious malfunctions have imperiled the ship's crew, and only you can restore order by repairing the ship’s systems.
The first several challenges within this mission are available today, with many more to come in the following weeks. Be sure to follow us on Twitter or join our mailing list to be the first to hear when even more new PHP content is available.
Meet the creator of the PHP mission
"Hi, my name …