Hello,
We use repositories to abstract the database logic okay ??
I have a simple interface for my repository like this one.
public function create($data = array());
public function deleteWhere($conditions = array(), bool $first = true);
public function updateWhere($conditions = array(), $data = array(), bool $first = true);
public function findWhere($conditions = array(), $columns = array('*'), bool $first = true);
public function all(bool $pagination = false, $columns = array('*'), $perPage = 20, $with = array());
so suppose I have a complex query like
$q->where(...)
->orWhere(function($q) { ... } )
->whereHas(....)
-> ...
how to abstract this one in the best way , I mean how to write the above
code using repository concept in the best way.