Retry After an Exception in a PHP Try/Catch Block

I originally posted this on Twitter and made a Gist, but thought I’d write a bit more about the subject of retrying after an exception is thrown in a PHP try/catch block. Since we’re all Laravel developers now and the world is run on APIs, we should recognize our...

Selecting and Aliasing Columns in Laravel

When you want to select specific columns using Eloquent or Query Builder in Laravel, no one would blame you for reaching for sleect() or selectRaw(). But, did you know that you can specify column to select in the all(), get(), and first() methods as well? What’s more, aliasing columns,...

Laravel str_ordinal Helper Function

I recently submitted a PR to the Laravel framework to add a str_ordinal helper function. The function adds an ordinal indicator to a numeric value passed to its first argument. Simply put, it adds “st”, “nd”, “rd” and “th” to numbers. The PR was closed by Taylor within the...

Deleting Files with Laravel and PHP

I was perusing the Laracasts forum yesterday when I spotted a thread I recalled seeing a long time ago that someone had resurrected: How to delete a file using Filesystem. The original poster was having an issue using the File facade to delete a file. What followed was...

Laravel Homestead Add Packages After Provisioning

Laravel Homestead offers much of what you’ll need to develop your applications out of the box. However, you may end up with a project that requires software beyond what is installed by default. For shared/universal Homestead, be aware that anything extra you install or configure may affect your projects....

Laravel Forge SSL Obsolete Cipher Suite

Qualsys SSL Test A Plus
If you use Laravel Forge to provision your servers, you probably already know that it can install SSL via Let’s Encrypt. The process is as simple as clicking two buttons–one for the install and a second to activate. However, what Forge fails to mention is you need to add...

Manually Reset WordPress Admin Password

Ever lose or forget your WordPress admin password? Good news, as long as you have access to the database you can reset the password for the admin or any other user easily thanks to the fine folks at Passwordtool.hu. Just visit http://www.passwordtool.hu/wordpress-password-hash-generator-v3-v4 enter a new password then click generate....

MySQL 5.7 Errors Importing Dates 0000-00-00

One of the gotchas for users upgrading to MySQL 5.7 from previous versions is that strict mode is on by default. Thus, if you have dates in a dump file formatted as zeroes (e.g. 0000-00-00), your import will fail because that format is not allowed in in strict mode....