Laravel 4.2 generate sub query like this -
i want in eloquent way.
select * `documents` (`id` in (select `related_id` `common_data` `meta_key` = 'meta_key_name' , `meta_value` = '1') or `created_by` = '1')
thanks answer.
try it
$data = document::where(function($query){ $query->whereraw(" id in (select `related_id` `common_data` `meta_key` = 'meta_key_name' , `meta_value` ='1')") ->orwhere('created_by',1); })->get();
Comments
Post a Comment