Inspired, Alex decided to apply these principles to the project. The first step was to refactor the existing code to use repositories, which would encapsulate the data access logic. Alex created an EloquentRepository class that implemented an interface, defining the basic CRUD operations.
If you have a parent class and a child class, you should be able to use the child class in place of the parent class without breaking the application. Essentially, child classes shouldn't behave unexpectedly differently than their parents.
Let’s break down the core pillars of OOP and see how they apply to your daily PHP workflow. The 4 Pillars of OOP
Jeffrey Way, the founder of Laracasts, has dedicated entire series to the SOLID principles. These five design principles make software designs more understandable, flexible, and maintainable: