Object-Oriented Principles in PHP
Beginning developers are usually first introduced to procedural programming. But, before too long, they level up. Suddenly, an entirely different paradigm is introduced: object-oriented programming. Little do they know that they'll spend years researching and learning exactly what it means to work with objects and messages.
In this course, you'll be introduced to the core principles of object-oriented programming through the lens of PHP. We'll begin with the basic constructs and work our way up. The only prerequisite is an elementary understanding of the PHP language and syntax.
Series episodes
Classes
9m 12sDiscover PHP classes as blueprints for your code. Learn how to define structure and behavior to build clean, organized applications in this friendly Laracasts lesson!
Objects
10mLearn how to create and use objects in PHP by working with class instances, constructors, and internal state. Build solid OOP foundations in this Laracasts lesson!
DTOs, Types, and Static Analysis
12m 22sLearn how to create DTOs in PHP and use static analysis with types to ensure data validity. Boost your code quality in this clear, hands-on Laracasts lesson!
Dependencies, Coupling, and Interfaces
20m 6sUnderstand dependencies, coupling, and interfaces to write flexible, maintainable code. Join this Laracasts lesson to improve your object-oriented skills!
Inheritance and Abstract Classes
19m 45sLearn inheritance and abstract classes in PHP with clear, practical examples. Understand how class hierarchies work to write cleaner, reusable code.
Interfaces as Feature Filters
12m 43sExplore how interfaces in PHP can act as feature filters, not just contracts. Learn to control functionality and enhance your code’s flexibility and design.
Encapsulation and Visibility
20m 55sUnderstand encapsulation and visibility in programming. Learn how hiding internal object states improves class APIs and keeps implementation details private.
From Getters and Setters to Property Hooks
15m 23sDiscover how PHP 8.4 property hooks transform class design. Learn the role of getters and setters and modernize your code with new language features!
Understanding Object Composition and Abstractions
19m 16sExplore object composition and abstractions to build complex systems from simple parts. Learn how classes can connect for powerful, flexible code design!
Object-Oriented Workshop
30m 46sBuild a flexible FileStorage interface in this hands-on workshop. Learn to swap implementations based on environment and master object-oriented design!




