Eloquent Query Classes Pattern
– wendelladriel.com - submitted by Wendell Adriel
Learn how to use Eloquent Query Classes to organize important database logic in Laravel without adding a full repository layer.
Read more [wendelladriel.com]
Posts tagged with design patterns
– wendelladriel.com - submitted by Wendell Adriel
Learn how to use Eloquent Query Classes to organize important database logic in Laravel without adding a full repository layer.
Read more [wendelladriel.com]
– wendelladriel.com - submitted by Wendell Adriel
Learn what the ADR (Action/Domain/Responder) pattern is and how to apply it in Laravel with a simple, practical example.
Read more [wendelladriel.com]
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"As a Laravel developer, this is the one newsletter I most look forward to. Freek has a talent for distilling packages or techniques down to something immediately useful - one tip can save you hours and even weeks. It's concise and practical and highly relevant."
– tighten.com - submitted by Kayla Helmick
This post explores what Delegated Types are, highlights their benefits, compares them to alternatives like Single-Table Inheritance (STI), and examines practical use cases they enable.
Read more [tighten.com]
Laravel Fuse is a circuit breaker package for Laravel queue jobs. When an external service like Stripe or Mailgun goes down, instead of letting thousands of jobs timeout (30s each), the circuit opens after a configurable failure threshold and jobs fail instantly. It supports three-state circuit breaking (closed/open/half-open), intelligent failure classification (429s and auth errors do not trip the circuit), peak hours config, and a built-in status page.
Read more [github.com]
– ryangjchandler.co.uk - submitted by Ryan Chandler
Adding fake() methods to your custom facades in applications and packages can provide some nice DX and APIs.
Read more [ryangjchandler.co.uk]
– wendelladriel.com - submitted by Wendell Adriel
Learn what the State Machine Pattern is and how to apply it in your PHP applications with this in-depth article about it
Read more [wendelladriel.com]
– www.eloquentarchitecture.com - submitted by John Freeman
You're three months into a new job when someone mentions "we have a dozen different branches for our customers." Learn how to escape the custom code nightmare with four proven patterns that actually scale, plus real Laravel examples.
Read more [www.eloquentarchitecture.com]
– muhammedsari.me - submitted by Muhammed Sari
Everyone knows the classic decorator pattern—but have you met its duck-typed cousin? Discover how to extend Laravel behavior without interfaces, the clever way.
Read more [muhammedsari.me]
– bert.gent - submitted by Bert De Swaef
If you’ve been working with Laravel for a little while, you’ve probably come across observers and event listeners. But what is the difference?
Read more [bert.gent]
While scopes are useful for simple queries, custom query builders are preferred for complex or frequently used queries.
Read more [blog.oussama-mater.tech]
– davorminchorov.com - submitted by Davor Minchorov
Learn about data transfer objects, why they are useful and why it's better to use them over arrays.
Read more [davorminchorov.com]
– alsterholm.com - submitted by Andreas Alsterholm
A blog post explaining some benefits (and drawbacks) of using custom Eloquent collections.
Read more [alsterholm.com]
– ashallendesign.co.uk - submitted by Ash Allen
Learn how to use the Pipeline class in Laravel to break complex workflows into smaller, isolated, focused processes. We'll then look at how to test our Laravel pipelines.
Read more [ashallendesign.co.uk]
– www.harrisrafto.eu - submitted by Harris Raftopoulos
Laravel's accessor caching with shouldCache() boosts performance by preventing repetitive computations for expensive accessors. Additionally, you can work with complex data like addresses using value objects, and Laravel will auto-sync changes back to the model. This improves code efficiency and maintainability, especially for structured data.
Read more [www.harrisrafto.eu]
Tempest, the framework Brent Roose is working on, allows you to attach a tag to a singleton definition, which means you can have multiple singletons of the same class, as long as their tags differ.
Read more [stitcher.io]
– alsterholm.com - submitted by Andreas Alsterholm
This article showcases how you can use Eloquent models, rather than a traditional boolean column, as flags in your Laravel application.
Read more [alsterholm.com]
– davorminchorov.com - submitted by Davor Minchorov
Learn about the differences between thinking in terms of data (CRUD) vs thinking in terms of business processes (behaviour) and how it affects code maintainability.
Read more [davorminchorov.com]
– blog.oussama-mater.tech - submitted by Oussama Mater
Have you ever wondered how Laravel switches between different drivers' implementations? Well, hang tight, we will learn how!
Read more [blog.oussama-mater.tech]
– acairns.co.uk - submitted by Andrew Cairns
Explains what the Code Smell 'Primitive Obsession' is, the damage it can cause to your codebase, how to spot it and - how to fix it!
Read more [acairns.co.uk]
– svenluijten.com - submitted by Sven
Diving into the difference between Laravel's facades and PHP's class aliases.
Read more [svenluijten.com]