Add Facebook, Twitter, and GitHub Login To Laravel with Socialite
Using social media accounts to sign up for websites is common nowadays and preferred by users because they don’t have to remember a password every time they login to a website. Even though social signup is easy, you can also inadvertently end up with a bunch of very confused users in an app.
When a user signs up with one social provider such as Facebook and then signs up with a different provider such as GitHub the next time, we shouldn’t end up with two different users on the site. I should be recognized as the same user provided I am using the same email across different social platforms.
In this tutorial, we are going to add Social Authentication to a Laravel app through Socialite, an official Laravel package which makes adding social authentication to a Laravel app a breeze.
Overview: Social Authentication in Laravel
We’ll be ...
How to Send SMS Reminders from PHP Symfony Applications
If you have a booking system, making appointments such as massage or other therapist bookings, dental or medical appointments, etc., you’d probably like to remind the client about the booking they made on the day of the appointment. In some cases, you might also want to remind the person offering the service. In this tutorial, you'll learn how to send SMS reminders to clients of their upcoming massage appointments, at a designated time before the appointment, in a
Symfonyproject using Twilio's SMS service.
This post assumes that:
- You have already set up a LEMP, MAMP, XAMPP, or equivalent development environment.
- You are familiar with the
We’ll be using
composer(a tool for dependency management) to install
Twilio's SDK. Composer installation instructions can be found here. Also, be sure to install
composerglobally, by following the instructions in the global sub-section.
After installing ...
Introducing PHP Developer Marcus Battle
The house lights darkened. Drums began to play from backstage. Strings warmed up the orchestra pit. Suddenly there were the words I had secretly been waiting for. The ones that the average American still gets wrong twenty years later, but loves to unashamedly sing. "Nants ingonyama bagithi Baba." The introduction to the “Circle of Life” was ringing throughout the auditorium.
I found myself in a parade of 750 pounds of silicone rubber fashioned into Zulu costumes, 18-foot giraffes, flocks of birds in the mezzanine and 6-foot elephants walking through the aisles. The entire auditorium became the stage. The floor opened up to expose Pride Rock and Simba's dedication. My inner child awoke. I completely gave in to experiencing "The Lion King" on Broadway.
“Dad, don’t we eat the antelope?
Yes, Simba. But let me explain.
When we die, our bodies become the grass.
The antelopes eat the grass ...
PHP + Twilio + Whatsapp: Would You Like to Play a Game?
There are 1.5 billion people using WhatsApp's end to end encrypted messaging platform to communicate. Many of those people prefer WhatsApp to SMS and other messaging platforms. It's currently the most popular messaging app in the world.
Twilio is adding options to the same API calls you use to send and receive SMS messages with Twilio, so you can now reach those users the way they prefer: on WhatsApp.
Using the Twilio API Sandbox for WhatsApp in your Twilio console, you can experiment with this new channel for connecting your software to the world.
Here are a few ways you can play with the Twilio API Sandbox for WhatsApp using PHP.
Before Getting Started
To code along with this post, you'll want:
Round up: Libraries for checking Pwned Passwords in your 7 favorite languages
Earlier this year Troy Hunt released version 2 of his popular Pwned Passwords API service. The new version comes with even more compromised passwords and a more secure way to query the password API that doesn’t require sending plain text passwords over the network.
The API update comes at a good time. When NIST updated its password guidelines in 2016, it included a new recommendation to check “memorized secret verifiers”, or passwords, against known data breaches:
When processing requests to establish and change memorized secrets, verifiers SHALL compare the prospective secrets against a list that contains values known to be commonly-used, expected, or compromised. For example, the list MAY include, but is not limited to passwords obtained from previous breach corpuses.
Since the API release, the community has created API wrappers in many of our favorite programming languages. In this post, I round up the libraries in 7 languages ...
Creating a Jenkins Server for GitHub Projects
A deploy process should provide consistency, incorporate tests, and utilize a multi stage deploy process to protect your production server, provide useful logging, catch breaking changes quickly, and integrate smoothly with your version control software.
There are a few options available for managing a deploy process like this. Many of these are managed services which means much of it is opaque and outside your control. If you’re like me, you’d rather have total access to and control of your deploy chain. The best option for control freaks like us, is Jenkins.
This post will walk through creating a dedicated Jenkins server and setting it up with an SSH key on your GitHub account.
Moving forward this post will assume a few things about you and your project:
How to Verify Phone Numbers with PHP, Symfony and Twilio
In this post we’ll learn how to verify phone numbers with Twilio in a Symfony project. We will discover how to model and validate a user’s phone number, and then use Twilio’s PHP SDK to create a call flow where the user has to enter a 6 digit code to verify themselves. The frontend view will provide a form to capture their number, displaying further instructions or validation errors, and then seamlessly redirect the user to another page once they’ve been verified.
If you need a refresher on Symfony, check out creating a Symfony 3 project with basic user handling. Those of you who don’t use Symfony should be able to carry the core ideas across to your framework of choice. Knp University’s screencast on Joyful Development with Symfony 3 is also helpful for starting a new project.
Check out this example project on ...
How to Receive SMS in WordPress with a PHP Plugin
In this tutorial, we’ll walk through on how to set up receiving SMS in WordPress with a PHP plugin. When the plugin is installed you will be able to respond to SMS and handle two-way messaging in your WordPress sites.
- A ready WordPress installation. If you do not have one set up, here are the installation instruction.
- A Twilio phone number. You can use an existing phone number or purchase a new one from the Twilio Console.
Our two-way messaging project
When you send out SMS to your users, there is a chance that some users might reply to your SMS. When a user replies, the message is received by your Twilio number, Twilio will make an HTTP request to the message URL configured for that number. In your response to that request, you tell Twilio what to do in response to the SMS using Twilio’s subset ...
Creating a Symfony 3 Project with Basic User Handling
User handling is a fundamental part of a ton of web projects. This post will walk through how to get setup using the Symfony 3 framework and the Friends of Symfony bundle so that your project can allow users to register, login and out, and view and edit their User profile. The steps here will serve as a great starting point for your next web project.
This post will assume you have already set up a couple of things:
- make sure you have a working database user and password – you will need to input these during the install process
Install Symfony Standard Edition
The install command will create a new folder and build the project within it. Inside the directory where you would like to place your project folder run the following command:
composer create-project symfony/framework-standard-edition UserLove
Interactive Install ...
How to Send SMS in WordPress with a PHP Plugin
Writers want to stay in touch with their readers. Sending bulk SMS is a great tool to have in your toolbelt. Let’s build a WordPress plugin in PHP so you can send text messages to readers about topics they care about.
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.
First, we need to install WordPress if you haven’t already. You can download and install one locally by following the installation instructions here. I have my WordPress installation path as
localhost/sendex/. I’ll be using it as my reference all throughout this tutorial.
Once you are done with the installation, log into your WordPress admin dashboard. This is where we will be working from now on. The admin dashboard should be