Tutorials and Talks
Laravel Collections “when” Method
Starting at v5.4.12, Laravel Collections now includes a when method that allows you to perform conditional actions on the items without breaking the chain. Like all the other Laravel Collection methods this one can have a lot of use cases but one example that comes to mind is being able to filter based on a query string parameter.
Writing Async Libraries – Let’s Convert HTML to PDF
I can barely remember a conference where the topic of asynchronous PHP wasn’t discussed. I am pleased that it’s so frequently spoken about these days. There’s a secret these speakers aren’t telling, though… Making asynchronous servers, resolving domain names, interacting with file systems: these are the easy things. Making your own asynchronous libraries is hard. And it’s where you spend most of your time!
Environment Variables, Config Caching, and Laravel
As part of the recommended production deploy process it is important to run the caching commands that Laravel affords us via Artisan. This means running config:cache and route:cache, which will compile the config and route files down into a single file each. In doing so, Laravel aims to speed up parsing of these files by only needing to read a single, rather than multiple files.
A Closer Look At Git Rebase
For some, git rebase falls on the magic end of the spectrum for Git commands. In this post, we'll take a closer look at git rebase.
Building Your Startup: Increasing Security
In the prior episode, I covered primarily web server security and access control. In today's episode, I'll discuss additional safeguards that I added to Meeting Planner. Since all the code is written in the Yii2 Framework for PHP, I was able to leverage the framework for a number of these fortifications.
Manage Custom VM with Laravel Forge
I had a legacy php application that I wanted to move to a newer version of php. This application is not built on Laravel but rather is a conglomerate of a bunch of different php scripts and pieces of different frameworks. We recently deployed a Laravel-based application to a server running on AWS via Laravel Forge and Laravel Envoyer and fell in love with the service. We were completely up and running in about 10 minutes and it was great.
PHP and SQL Server for Linux
Microsoft announced the availability of a public preview of SQL Server for Linux on the 16th of November, 2016. This week we tested the public preview of Microsoft SQL Server for Linux using PHP 7 with our component zendframework/zend-db.
Testing is an essential aspect of development, and test code should be treated the same way with regard to defining and using coding conventions and standards. This time I would like to share few conventions that I follow when writing unit tests in particular, some of which I adopted only recently.
Automating the Deployment of Encrypted Web Services with the AWS SDK for PHP (Part 2)
In the first post of this series, we focused on how to use Amazon Route 53 for domain registration and use Amazon Certificate Manager (ACM) to create SSL certificates. With our newly registered domain available for use, we can proceed to deploy and configure the services we need to host the www.dev-null.link website across an encrypted connection. Once complete, the infrastructure configuration will reflect the diagrams below.
The Death Star Version Constraint
PHPUnit 6, a new major version of the de-facto standard for testing PHP-based software, was recently released. Soon after, the test suites of developers who did not yet want to upgrade to the new version stopped working. What had happened? In a nutshell, these PHP developers were caught off guard by the consequences of using the "Death Star" version constraint in their composer.json file, the * operator.
Review: Refactoring to Collections
“Never write another loop again.” A strong promo sentence used by Adam Wathan to market his Refactoring to Collections book, but does it hold the promise? Well, together we will explore how close that claim is to reality.
Simple PHP Queue Worker
During development, restarting the queue worker is tedious. Better separate worker and functionality by calling external scripts.
Handling Multiple Exceptions in PHP 7.1
Exception handling is one of the ways in which modern languages handle errors. PHP usually handles exception in a separate catch block for each different type of exception. Below is a example exception code that uses three custom exceptions ‘MyFooException’, ‘MyBarException’ and ‘MyBazException’ that is later handled in a ‘try’ block.