like count and min , max , I am trying to use sum and max query in the orm chaining query but i am geting an error in to it. can u tell me is their any way to use sum and avg in orm query or we can not use this in orm
ORM only supports these methods on a total result, like $model->count(); or $model->max('amount'); As ORM doesn't support partial or custom selects, it doesn't support these SQL statements as part of the select.
So you can't inject a "MAX(column) AS MaxValue" into a select of a get() operation. It is not what an ORM is made for, it's not a query builder. So if you have complex questions, use DB.