-
How to Create a News Feed with Goutte and Twilio's Message Scheduling API
I've long been a fan of newsreader applications. Mostly for the convenience of being able to keep up with the stories, writers, and publications that interest me. That said, I'm also aware of the negative impact of such apps on my daily productivity.
The frequent interruption of my concentration by clickbait headlines is proving to be quite frustrating — especially as I fall for it every time. Yet, I'm somewhat hesitant to unsubscribe for the sake of FOMO (Fear of Missing Out).
For this millennial, the struggle is real. So, if you're like me and you share the dilemma of staying socially current while avoiding the trap of sensational headlines, you will find this tutorial incredibly helpful.
What will you build?
You will learn how to create a personalised news feed application that will text the day's headlines at the end of each day. The project will be powered …
-
Make Phone Calls Using PHP and Twilio Programmable Voice
There are so many things that you can do in PHP, including creating websites, building command-line tools, generating images, encrypting and decrypting data, and scraping websites.
But did you know that PHP can also make phone calls? Okay, not on its own it can't, but with the help of Twilio Programmable Voice, it can! In this tutorial, you're going to learn how.
Prerequisites
To follow along with this tutorial you will need the following:
- PHP 8.1.
- Composer globally installed.
- A Twilio account. If you are new to Twilio click here to create a free account.
- A Twilio phone number.
- A phone that can make and receive phone calls.
Set up your environment
The first thing you need to do is to create a project directory and change into it. To do that, run the following commands.
mkdir twilio-voice-call cd twilio-voice-call
Next, create a new file named .env …
-
Send One Time Passwords Over Voice Calls in PHP Using Twilio Verify
In recent years, user authentication in web applications has become a serious concern. For example, one-time passwords (OTP) are utilized to verify a user's identity; the most frequent method for sending OTPs is via SMS to the user's registered cellphone number.
In this tutorial you will learn how to send one-time passwords to users over voice calls in PHP using Twilio's Verify Api. In doing so, you will create an OTP system that can be used as an additional security layer for specific operations in your application.
Prerequisites
To follow this tutorial, you need the following:
- PHP 7.4 or higher with the PDO extension and PDO MySQL extension installed and enabled.
- Composer globally installed.
- MySQL and the MySQL command-line client (or an alternative database tool, such as DataGrip).
- A Twilio account. If you are new to Twilio, click here to create a free account.
Application Process
Here's …
-
Develop a GraphQL-Powered API With Symfony
For years, REST (Representational State Transfer) has been the de facto standard when designing APIs. That's quite understandable, as it's a very straight-forward structure: After sending a request to an endpoint, a JSON (or XML) response is returned to the client.
However, as applications became more complicated a recurrent theme started to emerge - multiple REST calls are required to populate a view. Enter GraphQL. With GraphQL, the sender of the request determines the structure of the response, thus providing more flexibility and efficiency to the frontend.
In this article, I will show you how to develop a GraphQL-powered API for an online book store with Symfony.
Prerequisites
To get the most out of this tutorial, you need the following:
- A basic understanding of GraphQL
- Basic experience with PHP and Symfony
- PHP 8.0
- Composer
- The Symfony CLI
Getting Started
Create a new Symfony application, and …
-
Improve PHP Web App Performance Using Memcached
In the first part of this series, I stepped through how to create a Markdown-powered blog in PHP using the Slim Framework. In this, the second part in the series, you're going to learn how to use Memcached with PHP to improve the application's performance.
Let's begin!
Prerequisites
You need the following to follow this tutorial:
- Some familiarity with caching, Markdown, YAML, and the Twig templating engine.
- Some familiarity with the Standard PHP Library (SPL).
- PHP 7.4+ (ideally version 8) with the Memcached extension installed and enabled.
- Access to a Memcached server
- Composer installed globally.
Why use caching?
While the initial version works perfectly well, its performance would peak reasonably quickly, because — on every request — the blog data is aggregated from a collection of Markdown files with YAML frontmatter in the application's filesystem, parsing out the article data before the blog data can …
-
Build Your Own Weather Station With PHP, Python and a Raspberry Pi
Raspberry Pi, Arduino, BeagleBone, and similar technologies have had a revolutionary impact on so many people around the world.
Because they provide the building blocks of computing for a very low price, anyone, from a school student to a retiree, with a little bit of time and effort, can build a device that perfectly scratches whatever itch they have. They no longer need to wait for a commercial organisation to build it.
One such itch (at least one that I have) is to measure the current temperature and humidity throughout the rooms in my home. Sure, weather app's can tell you the current temperature and humidity, however, they can only do it for a wide geographical area.
So, in this tutorial, you're going to learn how to create a small weather station with a Raspberry Pi, some PHP and Python code, and a temperature and humidity sensor — for …
-
How to Create a High Converting Sales Page Using PHP, Twilio Messaging, Google's App Engine, and Stripe's API
Today's fast-paced, digital economy has created a culture where people want to know how to compete in the global market, what skills are emerging, and how best to learn them.
Consequently, more and more people are choosing educational resources, such as ebooks and video tutorials, to help us fill the knowledge gap necessary to improve our lot in life.
And why not? Whether it's resume writing, DIY, or personal budgeting, there's a guru ready to take you from novice to ninja — "in just seven days!"
Forecast to be worth $350 Billion by 2025, the online learning industry has not only taken the world by storm, it has also created new opportunities for everyday people to become digital entrepreneurs.
With the abundance of e-commerce platforms, website builders, and content management systems readily available, just about anyone can launch a sales page and start selling e-courses or ebooks.
How does …
-
A Beginner's Guide to Test Driven Development With Symfony and Codeception - Part 3
Welcome back! It’s been an amazing tour of planet TDD (Test Driven Development) so far. In this series, you’ve learned the benefits of TDD, and gotten your hands dirty building a P2P (Peer-to-peer) payment application.
Using Symfony and Codeception, you’ve worked through the Red-Green-Refactor cycle, gradually implementing new features via Sliming. You've also seen how TDD protects code from regressions.
In this, the third and final part in the series, you'll implement the last feature of the application using TDD, transaction history. In addition to that, you'll learn about the concept of test coverage and how it impacts application reliability.
Prerequisites
To follow this tutorial, you need the following things:
- A basic understanding of PHP and Symfony
- Composer globally installed
- Git
- PHP 7.4
- The Symfony CLI
Getting started
If you already have the code from the first part in this series, you can skip this section. However, …
-
How to Manage Application Secrets With PHP Using Vault
For far too many years, PHP developers stored application credentials and secrets, such as usernames, passwords, and API keys, alongside their code.
While extremely convenient, this practice was a security nightmare just waiting to happen; if someone could access an application’s source code, they had access to all of its sensitive data too.
Nowadays, this practice is nowhere near as common as it once was. Rather, it's now incredibly common to store credentials separately from code in dotenv files (.env) which makes them available as environment variables.
However, while this is a significant improvement, this practice still isn't the best way to keep credentials and secrets secure. For example, if the .env file is accidentally committed to version control, then the credentials and secrets are once again stored alongside code.
Alternatively, if a malicious actor can access the environment where an application is running from, they can access …
-
Send Scheduled SMS with PHP and Twilio Programmable Messaging
Twilio Programmable Messaging lets you send SMS, MMS, and WhatsApp messages. However, up until recently, it didn't support scheduling messages for a future date and time. If you wanted to do that, you had to roll that functionality yourself, likely using a Cron job, or some scheduling tool, to retrieve stored messages from a database, and create them when they needed to be sent.
Now, though, you can schedule SMS messages with a single API call using Message Scheduling!
In this tutorial, you’ll learn how to schedule SMS ahead of time using PHP. To make the tutorial a little more meaningful, assume that you are writing the code to help remind people about upcoming meetings of the local club that you're a member of.
Tutorial Requirements
You will need these items to follow along with this tutorial:
- PHP 7.4 (ideally 8.1)
- Composer installed globally
- A free or paid Twilio …