The fillable vs guarded debate has been going on for years, and most of the arguments are well-known by now.
But here is one you might not have heard before.
Using guarded triggers a hidden database query every time you create or update a model.
In this video, I dig into the framework source code to show you exactly where this query comes from, why Laravel needs it, and how fillable avoids it entirely.
And after watching, don't forget to subscribe to our YouTube channel, so you don't miss future videos.
Here to help,
Joel
P.S. Understanding what happens under the hood in Laravel helps you write better code. If you want to level up your Laravel skills, join the community.