Reputation: 493
I have recently started using the PHP framework Laravel, and built some web apps using it.
On the Laravel Documentation, it says that models makes it easier to query data from our database and insert data into our database. But I made some apps (albeit, the apps I made were pretty small since they were strictly for learning purposes), and I didn't really use Models. I built the ER using MySQL Workbench, and forward engineered it to get my database and I worked on from there, making 0 models.
My question is, why is it recommended that we use Models when interacting with our database? Do models make it easier when size of the project increases?
I just want to learn it the right way.
Upvotes: 0
Views: 69
Reputation: 426
Here are Laravel advantages when using Models (Eloquent):
Any way, working through models makes your code more structural, you reduce code duplicates, you can make unit tests, all routine work done by framework. And that is MUST HAVE for today.
Just try to use it and you will understand how it is awesome.
I would recommend you to check this: https://laracasts.com
Upvotes: 2