From the course: PHP: Design Patterns

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Solution: Apply the active record pattern

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.

Contents