Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Laravel 4 Basics Getting Started with Laravel Frameworks & MVC

Did I miss the reference to the DB in the video? I have watched it twice and didn't hear any DB reference.

I am possibly missing something here but I didn't hear any mention of a DB in the video. I have notes that the Model notifies the controller & view of status changes - is the controller the DB in this question?

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Mike;

Great question. The MVC (Model-View-Controller) model can initially be a little challenging to grasp where all of the pieces fit. Here is how I have come to terms with the responsibilities of each piece.

Model

The Model directly manages the data, rules, and logic of the application. This would be where the database falls into place.

View

The View is what the end user sees, the data represented as viewable output.

Controller

The Controller accepts input and then converts those commands for the View or the Model to act upon those commands.

Perhaps this diagram will help:

MVC Concept

Does that help at all? Very high level of MVC, but by keeping in mind what and where things are done, it can help to make sure code goes into the right spot.

Happy coding,

Ken

Ken,

Thank you! That should help - I've copied this and will keep it as a reference.

Mike

Ken Alger
Ken Alger
Treehouse Teacher

Mike;

In reviewing my answer I apologize for not addressing your specific question about the video. I would have to review the video again for specifics, but you had it correct in that, generally speaking, it is the job of the Model to notify the other components of changes in data status.

Ken