I have this query, it is working on oracle DB, How can I convert it to eloquent equivalent?
select count(v.ID), v.SITE_NAME, to_char(v.REGISTRY_DATE,'yyyy')
from abc.vehicles_v v
where to_number(to_char(v.REGISTRY_DATE,'yyyy')) > 2012
and v.LAST_CANCEL_ID is null
group by v.SITE_NAME,to_char(v.REGISTRY_DATE,'yyyy')
order by 2
DB::raw("
select count(v.ID), v.SITE_NAME, to_char(v.REGISTRY_DATE,'yyyy')
from abc.vehicles_v v
where to_number(to_char(v.REGISTRY_DATE,'yyyy')) > 2012
and v.LAST_CANCEL_ID is null
group by v.SITE_NAME,to_char(v.REGISTRY_DATE,'yyyy')
order by 2
");
$query = "select count(v.ID), v.SITE_NAME, to_char(v.REGISTRY_DATE,'yyyy')
from abc.vehicles_v v
where to_number(to_char(v.REGISTRY_DATE,'yyyy')) > 2012
and v.LAST_CANCEL_ID is null
group by v.SITE_NAME,to_char(v.REGISTRY_DATE,'yyyy')
order by 2";
$data = DB::select($query);