getModel()::getDB())->when(isset($where['reconciliation_id']) && $where['reconciliation_id'] !== '',function ($query)use ($where){ $query->where('reconciliation_id',$where['reconciliation_id']); })->when(isset($where['type']) && $where['type'] !== '',function ($query)use ($where){ $query->where('type',$where['type']); }); } }