Category Archives: Tutorial

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

Posted in Tutorial | Leave a comment

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

Posted in Tutorial | Leave a comment

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

Posted in Tutorial | Leave a comment