Author Archives: Vincent Bergeron
Understand Laravel Magic: How Eloquent Models Dynamically Retrieves Attributes
I’ve been working with Laravel for almost eight years, and I think I know Eloquent pretty well. But for a long time, I didn’t fully understand what happens under the hood when accessing properties on a model instance—and I’m sure … Continue reading
Laravel’s PHP attributes
Happy New Year! Lately I’ve been quite excited by Laravel’s PHP attributes. Attributes offer the ability to add structured, machine-readable metadata information on declarations in code: Classes, methods, functions, parameters, properties and class constants can be the target of an … Continue reading
Preventing Transaction-Related Issues in Laravel
Today, I spent a good amount of hours troubleshooting an issue involving database transactions. Thankfully, with the assistance of a teammate, the problem is now resolved. Consider the following example code: In this scenario, we initiate a database transaction in … Continue reading
How I test Laravel Middlewares in isolation
Not so long ago, a colleague of mine showed me a method to test middlewares that totally changed how I test them now. For a long time, I tested middlewares by creating a fake Laravel request, instantiating the middleware, and … Continue reading
Welcome to vbergeron.dev!
Welcome to my personal website. Creating a personal website has been on my mind for ages, but I always procrastinated. On this website, you can expect some blog posts that I’ll write as I come across interesting things while developing … Continue reading