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.

Challenge: Apply the active record pattern

Challenge: Apply the active record pattern - PHP Tutorial

From the course: PHP: Design Patterns

Start my 1-month free trial

Challenge: Apply the active record pattern

- In this Challenge, I've left you a simple structure at index.php in the Challenge folder. It assumes there's a post.php file with the actual post class implemented. Then you call the create method as an array of properties, and it should get inserted into the database. I've also provided a sample composer file, as you'll have to install the Eloquent ORM. When in doubt, look in the Example folder to see how it might work. This is a relatively short exercise and should only take you about 15 minutes. When you're finished, check the Solutions folder for one particular solution.

Contents