Using Take and Offset Not Get Data in with method

Posted 3 years ago by sandygajera

hi , i am use a laravel 4.2 in that i write below query but i can not receive data query: $shipping_counteroffer_details = ShippingDetails::where('id','=',$id)
->with(array('shipping_counter_offer'=>function($query) use ($user_details) { $query->where('i_shipper_id',$user_details->id); $query->orwhere('i_driver_id',$user_details->id); $query->orwhere('i_driver_id','0'); $query->skip(0)->take(1); $query->orderby('d_created_date','desc') ->select('id','i_shipping_id','i_driver_id','i_shipper_id','f_counter_value','v_comment','e_counter_offer_status','e_offered_by'); }))->get()->toArray();

but if i remove $query->skip(0)->take(1); line from above query then i get a all records as per query but actually i get only one latest records as per date wise so plz help what i do wrong in above query or is there any other way to get latest records as per date wise

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.