PHP is great, but its loosely-typed goodness is a double-edged sword. On the one hand, it gives PHP the legendary low barrier to entry, but on the other, magical type juggling inevitably means bugs.
Because PHP is an interpreted rather than compiled language, catching these type problems is tricky, and often they'll go unnoticed for a long time before they catch up with us somewhere down the road. Problems sit and fester in our code base waiting to strike. Unused code can clutter our application, and there is a myriad of other ways in which we write PHP that won't produce errors but are bugs.
There are some excellent tools to help us catch errors and find bugs before we even run our code. IDEs like PhpStorm can inspect our code and give us information on potential problems before a script is ever executed.
Catching problems with our code before …
Webhooks are generally automated calls made from one application to another, triggered whenever a specific event occurs. Each webhook transfers a payload to the receiving application. For example, Twilio uses webhooks to let you know whenever certain events occur such as an incoming SMS message or a phone call.
A really good use case is when you'd like to be alerted via SMS when different events occur on any third party services integrated with your application. As long as they provide webhooks, we can build a notification system around that.
To follow along, you’ll need the following:
Setting up Lumen
There are different ways to set up a new Lumen …
Sending and receiving SMS is easy with the Twilio API, but what if you want to send regularly-scheduled reminders from your Laravel web applications? In this tutorial, we'll combine Laravel, Twilio Programmable SMS and cron to send daily reminders that are stored in a Laravel data model.
We'll need the following dependencies to complete this tutorial:
- PHP version 7+
- Composer installed globally
- Your Twilio credentials, which you can sign up for an account for free
We can start building our project once you have PHP 7 and Composer installed. We'll sign up for a Twilio account at the appropriate step in the tutorial.
All of the code for the project can be found within this Git repository on GitHub.
Create a Laravel Project with Composer and the Twilio Helper Library
In your terminal, start a new Laravel project named
reminder-app using the following command:
Laravel provides a queue interface to help you defer long-running tasks such as sending emails/SMS, file processing, etc. As much as you try to avoid it, your queue will fail sometimes and because these failures are ignored by default, you need a way to be notified. In this article, we will explore how to send a Slack notification each time a queue fails.
Before Laravel 5.8.x, the Slack notification channel was pre-packaged into the framework. If your Laravel version is < 5.8.0, feel free to skip the installation (although you should look into upgrading as Laravel is currently on version 6.0). From Laravel 5.8.x and above, the Slack notification channel is packaged separately from the framework so we have to import it via:
$ composer require laravel/slack-notification-channel
Next, update your
.env file to include your Slack webhook URL …
Laravel 6.0 is released, and as a new major version, there are plenty of fun new features for us to play with. The release notes give us all the highlights, but as part of a recent stream, I decided to take a look at one of the more exciting additions, the new error handler, Ignition.
Ignition replaces Whoops as the default error handler in Laravel 6, but it works on older Laravel applications going back to version 5.5. The impressive thing about Ignition is because it's designed from the ground up to handle Laravel's specific errors, it can make suggestions on how to resolve errors, and even automatically fix common problems for us.
If we deliberately add a typo in our blade template name, then Ignition realises this and suggests the fix for us in the green panel.
Even smarter is the fact that Ignition can automatically …
Queues are ways in which we enable our application to listen and act based on predefined events. They allow us to delay tasks that would otherwise interfere with the user experience or our application’s performance.
What are we Building?
In this tutorial, we will be creating an application that utilizes Laravel queues to send our users “Happy Birthday” messages on their birthday. We will create a command that fetches all users whose birthdays are today, and sends them to the queue to be processed.
Setting Up our Application
As our application is Laravel-based, we will create a new Laravel application. If you're not …
Laravel is one of the most famous PHP MVC frameworks, largely due to its commitment to modern architecture and an active community. Notably, it provides all the features that are required to create your project, whether for personal or enterprise-level usage.
Slack is an online instant messaging and collaboration system that enables users to centralize notifications. From sales to tech support, social media and more, Slack becomes one searchable place where your team can discuss ideas and take action.
In this tutorial, we’ll be combining Slack, Twilio and Laravel to learn how to send an SMS from Slack. This would be a great feature for situations such as notifying users on the phone regarding an urgent meetup.
After we’re finished, you will have a running Laravel application that allows you to send SMS to tagged users in a Slack channel.
In this tutorial, we will be creating a Laravel application that will be used to make outbound voice calls. We will be making use of Twilio's Programmable Voice feature to learn how to initiate voice calls.
Completing this tutorial will require the following dependencies and a basic understanding of them.
Before we proceed with this tutorial, it is expected that you have a voice-enabled Twilio number. In case you do not have one, please proceed to purchase one here. This number will be used for the "from" number later in this tutorial.
Setting Up Your Development Environment
Let's install a new Laravel project via the Composer
create-project command. From your terminal, run the following command:
$ composer create-project --prefer-dist laravel/laravel twilio-voice
This will create a Laravel project for us in the
In a business environment, audio transcripts allow for easier collaboration as transcripts are easy to distribute and store. It also helps businesses to better understand their customers, which leads to improved customer experience. Lastly, it increases accessibility, particularly to people who are hearing-impaired and non-native speakers.
At a personal level, transcripts can help one to quickly discover actionable insights and improve accuracy as there is a written record that can be referenced.
Transcribing doesn’t have to be tedious. Using automated software and tools can expedite the process, thus saving you time to focus on other important things. One tool to expedite transcribing is Twilio’s Voice API.
To complete this tutorial, you will need the following:
My son just started kindergarten and his first year of not being homeschooled. To say that everyone was nervous was an understatement. Luckily, his school is filled with caring people who aren’t afraid to embrace technology for efficient communication (and calming nervous parents).
There we were, running errands after his drop-off and our phone was alerted with an email including a photo and message of his progress. The personal touch of being able to see him relaxed calmed our anxiety, allowing us to enjoy the remainder of our afternoon.
No matter how much we advance technology, it’s my opinion that we must find ways to include “human touch” as much as possible, even if it’s automated.
This got me thinking about how else I would like to be contacted by his school, especially in case of an emergency. Wouldn’t it be cool if, instead of 160 characters, I could receive …