Our top 10 Laravel Tutorials of 2021
Published on by Eric L. Barnes
As 2021 comes to a close let's take a look back at the ten most popular Laravel tutorials we published this year.
- Laravel firstOrNew, firstOrCreate, firstOr, and updateOrCreate methods - Laravel Eloquent has a few useful features like firstOrNew, firstOrCreate, firstOr, and updateOrCreate and in this tutorial let's look at how they might be useful.
- Mistakes I've Made in AWS Here's a collection of the most commonly missed things when using AWS with Laravel Forge.
-
Understanding the sole() Query Builder Method
Laravel 8.23.0 introduced a
sole()
method to the query builder, which retrieves a single record but also has additional assertions. - Duplicate or Clone a database record with Laravel Have you ever needed to duplicate a database record? Laravel provides a very handy function for this called replicate which will take an Eloquent model and make a copy so you can then make changes and save it.
- The Ultimate Performance Checklist For Laravel Apps Laravel is fast out-of-the-box, but you can make it faster if you optimize your configurations and application code. This guide lists a wide range of performance tips from quick wins to advanced techniques that would help you make your Laravel app the lean, mean machine your customers want.
- Find N+1 problems instantly by disabling lazy loading Preventing lazy loading in development can help you catch N+1 bugs earlier on in the development process. The Laravel ecosystem has various tools to identify N+1 queries. However, this approach brings the issue front-and-center by throwing an exception.
- CLI to Check For PHP Security Vulnerabilities Enlightn Security Checker is a command-line tool that checks if your application uses dependencies with known security vulnerabilities.
- 5 Tips for the Laravel Service Container Mohamed Said published a new video on the Laravel Youtube channel outlining 5 tips for dealing with Laravel's Service Container
- "One of Many" Eloquent Relationship Added to Laravel The one-of-many relationship creates a one-to-one association from a one-to-many relationship.
- Creating Your Own PHP Helpers in a Laravel Project Laravel provides many excellent helper functions that are convenient for doing things like working with arrays, file paths, strings, and routes, among other things like the beloved dd() function. You can also define your own set of helper functions for your Laravel applications and PHP packages, by using Composer to import them automatically.
Thanks to Fathom analytics for making this list easy to put together, and we hope you have had a great 2021 and we look forward to seeing you again next year!
Eric is the creator of Laravel News and has been covering Laravel since 2012.