Category: Laravel

Selecting and Aliasing Columns in Laravel

No image
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

No image
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

No image
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

No image
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...

Laravel No Supported Encrypter Found

No image
When you create a new laravel project using composer create-project laravel/laravel, composer will generate an app key for your app after renaming .env.example to .env and write it as the value for APP_KEY. IF you install by another means, this key may not get generated and you will get the...

Priming MySQL Using Laravel Migrations

No image
In my current project, I needed to load zip code data into a MySQL table. There are a number of ways to do this, but I wanted a solution that could flex to much larger datasets and run fast. After doing some research, it seemed like the best way...