Can anyone tell me ORM or query builder which one will be better ?And it's benefit?
We use frameworks like Laravel to ease our work. When it comes to concept of frameworks, speed and ease of development is more important than performance. So by using ORM’s it provides powerful methods to handle with database without no need of heavy mysql knowledge. In case of query builder it’s provide methods to build queries in efficient manner.
As my experience there are some things that we can’t easily do with Eloquent. So then we need to use query builder to build direct queries.
So I think it’s not good to compare Eloquent and query builder.
You can find more details here.
But I can give you some tips to select one method.
ORM
Polymorphic Relationships
which is not provided in Query Builder
Hope these are enough
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With