-
How to Check Your Twilio Account Balance using PHP
Developers often forget that when building a communication-based app it’s important for you to monitor costs in real time. Imagine you’ve built a bulk SMS application and need to send one message to 1,000 subscribers. You already know that (in the US) this SMS will cost you $7.50 USD ($.0075/msg), but are you aware of the available balance on your account to send it? The answer is in the console, but it’s tedious logging into your Twilio account every time you need to use the API within your app.
If you’re building a PHP application that needs to calculate API costs before use, this tutorial is for you! Maybe your application needs to check your balance before sending SMS or alert you when you’ve used too many voice minutes. Whatever the use case, this quick tutorial will help you integrate your balance into your PHP app.
Get Started
This …
-
Create a Secured RESTful API with CodeIgniter and JSON Web Tokens
The growing use and applications of cloud services necessitates a more efficient architectural style than the Simple Object Access Protocol (SOAP). REST (REpresentational State Transfer) allows for a light-weight, stateless communication between clients and the Application Programming Interface (API). Because the communication is stateless, access control for Restful APIs is based on tokens which carry enough information to determine whether or not the client is authorized to perform the requested action on the resource.
In this tutorial, I will use CodeIgniter to build a RESTful API. CodeIgniter is a powerful PHP framework with a very small footprint which allows developers to build full-scale web applications.
Prerequisites
A basic understanding of CodeIgniter will be helpful in this tutorial. However, I will provide explanations and links to official documentation throughout the tutorial. If you’re unclear on any concept, you can review the linked material before continuing with the …
-
Build a Single Page Application in PHP with CodeIgniter and React
Having a clear dichotomy between client-side and server-side applications comes with many advantages such as separation of concerns and loose coupling, which allows teams to work independently. However this might be overkill for smaller teams or projects managed by the same person. In such situations, a better approach might be to have relevant code for both the front-end and back-end reside in the same project. In this tutorial, I’ll show you how to build a web application with React and CodeIgniter.
According to the official documentation, React is a JavaScript library for building user interfaces. My favorite feature of React is that it allows me to structure my web applications by breaking the interface into components and building accordingly. I’ve found this to add reusability and consistency to my applications.
CodeIgniter, on the other hand, is a lightweight open source PHP framework that allows developers to build web applications …
-
Build, Test, and Deploy Your Laravel Application With GitHub Actions
GitHub Actions help you discover, create, and share actions to perform any job you'd like, such as CI/CD, and combine actions in a completely customized workflow. In this tutorial, I’ll be showing you how to build, test and deploy a Laravel Application using GitHub Actions.
Prerequisites
You will need the following to get started with this
- GitHub account
- Knowledge of Laravel
- Knowledge of GitHub
- A live server
Getting started
Let’s create a new Laravel application:
$ laravel new laravel-github-actions
Next, create a repo on GitHub and push the new application to the repo. You can follow the instructions here.
I went ahead and created a repository on GitHub containing the application, which can be found at https://github.com/ammezie/laravel-github-actions in case you would like to just clone it instead.
Setting up GitHub Actions
Now, let’s set up GitHub Actions for the repository. Click on the Actions tab on the repository navigational …
-
Verifying Twilio API Requests in Symfony 5
Web applications are powerful tools of communication for everyday life. However, due to their ubiquity, the average user underestimates what it takes to actually build them. As a result, the human interfacing with the app just expects it to work, always.
While building an application is easier in 2020 than years prior, its success is often dependent upon the use and integration of external services to provide additional functionality.
Companies such as Twilio and Stripe offer these services (called APIs) that enable developers to quickly implement functionality that would otherwise be impractical to build independently. Because APIs tend to focus so much on installation, their “Getting Started” guides often guide the developer past the biggest part of their application outside of testing; security.
In this tutorial, we’ll do the opposite and take a look at security by verifying Twilio API requests in Symfony. To start, we’ll create a basic Symfony …
-
Build Chrome Desktop Notifications in PHP with Laravel 8, Pusher, and Twilio SMS
In modern day web applications, real-time notifications are very common as service providers want to keep users informed and engaged about events happening on their platforms. Notifications are a great way to build incentive for users to come back to the platform.
In this tutorial, we will be implementing a real-time application with desktop notifications by utilizing your browser’s Notification API, Laravel, Pusher, and notifications via Twilio Programmable Messaging.
Prerequisites
To follow along in this tutorial, here are the essentials to get started:
- PHP and Laravel 8 installed on your machine.
- Working knowledge of PHP and JavaScript.
- A Twilio Account
Set up a Laravel Application
This tutorial assumes that you are somewhat familiar with PHP and the Laravel Framework. Hence, we will quickly go through the installation process of Laravel and the procedures needed to create a brand new Laravel 8 Application.
Create a Laravel Application …
-
Build a Custom WordPress Plugin to Send SMS with Twilio Programmable Messaging
The tension of blogging really begins after publishing. Who read it? How do they feel? There are numerous questions that flood the mind of any author, but more importantly, most authors just want their content read.
Sending bulk SMS is a great tool to have in your toolbelt to encourage traffic to your WordPress blog. Imagine being able to send an SMS to every subscriber to your blog.
Let’s build a WordPress plugin in PHP using Twilio Programmable SMS and send text messages to readers about topics they care about.
Prepare WordPress for the Plugin
Plugins let you extend and add functionality to your WordPress site. Since we are adding an entirely new function to WordPress, we have to use a plugin to achieve this.
If you haven’t already installed WordPress, you can download and install a copy by following the installation instructions here. I have my WordPress installation …
-
Build an Automated SMS Survey with Laravel, PHP, and Twilio Programmable SMS
In recent years, SMS has been widely used as one of the cost-effective and seamless means of disseminating information in the form of a survey. This allows survey creators to reach a larger audience and facilitate gathering data more efficiently.
In this tutorial, we will build an automated customer survey application to receive customer feedback for a fictional company through SMS. In leveraging Twilio Programmable SMS, we will connect a Twilio phone number to a Laravel application to build the business logic that will determine when to begin the survey, the questions to ask, and a persistent layer to save the users’ responses. Each participant will send an SMS response to the Twilio number until the survey is completed.
Let's begin building an automated survey that can be answered via SMS!
Prerequisites
You will need the following to complete this project:
- Knowledge of building applications withLaravel
- A Twilio Account …
-
Retrieve and Send Live Bitcoin Rates Every Day Using CEX.io, Twilio SMS, and PHP
Ever wondered how platforms like Binance set price watchlists for different Bitcoin price alerts? If so, imagine getting a daily SMS alert whenever the price of Bitcoin changes.
This tutorial will teach you how to use Twilio Programmable SMS to send out live Bitcoin rates every day using your Laravel app. After we’re finished, you will be able to automatically send an SMS containing the conversion rate of Bitcoin to USD to your phone number, daily.
Installation Requirements
We will begin with a new Laravel project. Additionally, the following modules are required for proper functionality. These modules are:
- PHP 7.2+
- Composer
- Laravel
- Guzzle (Comes pre-installed with Laravel)
- A Twilio account
- CEX.io API
Having installed Laravel on your machine, proceed to create a new project using the Laravel CLI:
$ laravel new bitcoin_watcher
Or using the Composer
create-project
command:$ composer create-project --prefer-dist laravel/laravel bitcoin_watcher
Next, install Twilio’s PHP SDK to …
-
How to Create a Group Video Chat App with Symfony, PHP, Twilio, and React.js
If the news and current statistics about remote work are any indicator of the future, it’s obvious that working from home is gradually becoming the new normal for employees all over the world, including numerous tech companies. While effective communication may be defined differently for various companies, one of the most promising ways to improve productivity and keep your team together involves using video conferencing or chat.
This tutorial will guide you on how to create a video conferencing chat application using Symfony, React.js, and Twilio Programmable Video. The video chat application will allow users to connect and participate in a predefined chat room.
Prerequisites
To participate in this tutorial, you will need the following:
- A Twilio Account
- Composer globally installed on your computer to manage dependencies
- Preferred basic knowledge of building applications with React and Symfony
- Node.js and Yarn package manager installed on your computer
- Symfony …