Monday, April 10, 2017

Laravel 5 execute own query

Is any possible to execute this query in Laravel 5?.

select t1.*, v.hash from 
    ( select dr.*, d.id as d_id, d.name, d.user_id from directory d 
    left join directory_relations dr on d.id = dr.directory_id 
    union select dr.*, d.id as d_id, d.name, d.user_id from directory_relations dr 
    left join directory d on d.id = dr.directory_id ) t1 
left join videos v on t1.video_id = v.id WHERE t1.user_id = 265



via Jensej

Advertisement