Abstract Factory: Provide an interface for creating families of related objects without specifying their concrete classes. The Abstract Factory pattern gives you one interface for creating a family of related objects, without your code knowing which concrete classes it gets. You ask the factory for a button and a checkbox, and it returns a matching set.
The classic example is a UI toolkit with a light and a dark theme, or a Windows and a Mac version. Each factory produces components that fit together, and the rest of the code works with any of them.
What should you keep in mind with Abstract Factory?
In web applications you see it in drivers. A storage factory that hands out a local, S3 or FTP implementation is a simple version, and Laravel's managers for mail, cache and storage work along these lines. The pattern adds classes and indirection, so use it when you really have several families to swap between. For one implementation, a plain class is easier to read.
Apply Spatie's Laravel and PHP coding standards for any task that creates, edits, reviews, refactors, or formats Laravel/PHP code or Blade templates; use for controllers, Eloquent models, routes, config, validation, migrations, tests, and related files to align with Laravel conventions and PSR-12.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.