From the course: PHP: Design Patterns
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Apply the active record pattern - PHP Tutorial
From the course: PHP: Design Patterns
Solution: Apply the active record pattern
“
- The solution of this one is almost magic. Our original index.php file is unchanged. All we needed to do was add a post class in our posts.php file, and all it needs to do is extend the Eloquent Model. In fact, if you look at the example folder, you should see that it's identical. There's nothing else we have to do to solve this one.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.