php - Is an Eloquent Model the same as a MVC model (in laravel)? -
i saw post (the difference between eloquent model , model?) doesn't explicitly answer question me.
i may not using right terminology here...
i understand eloquent "...an activerecord implementation working database..." says in documentation. not clear me difference between these eloquent models, , models 1 refers them in mvc sense.
does sound logical if in particular laravel application
- there many models, of eloquent models, , of models in mvc sense.
- eloquent models quite lean , pure classes, allowing interaction database layer.
- mvc models, comparison may contain sorts of business rules & logic
- both types created
php artisan make:model
although eloquent model 1 might want create migration @ same time. - all models stored in same place, unless otherwise organised. it's not if there externally visible location or naming convention indicate eloquent model, or mvc model.
...is right?
- there models. of them have extended functionality using object-relational mapping methodology - eloquent ( 1 of many ).you can read more orm here:
https://en.wikipedia.org/wiki/object-relational_mapping
they not lean , pure. far blown , use lot of unnecessary data create relations between database object in form of easy read / use syntax. example
firstmodel->secondmodel->thirdmodel->somethingsilly();
mvc models can contain controller but answer convention should read more extensively mvc , logic behind it.
pretty that's purpose of artisan. make more simple , easy use.
yep.
if need bit more information can provide answers , url in comment below.
Comments
Post a Comment