O'Reilly logo

Laravel Design Patterns and Best Practices by H. İbrahim YILMAZ, Arda Kılıçdağı

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Model in Laravel

If you recall, we mentioned earlier in this chapter that there are many important jobs that the Model needs to handle. Laravel 4 does not use the MVC pattern directly, but it extends the pattern further. For example, Validation—which is part of the Model in the solid MVC pattern—has its own class, but it's not part of the Model itself. The database connection layer has its own classes for each database driver, but they are not packed in the Model directly. This brings testability, modularity, and extensibility to the Models.

The Laravel Model structure focuses more on the database processes directly, and it is separated from other purposes. The other purposes are categorized as Facades.

To access the database, Laravel has two ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required