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

Solution: Apply the active record pattern - PHP Tutorial

From the course: PHP: Design Patterns

Start my 1-month free trial

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