gurvindersingh
6 months ago

I have DateTime field in my DB table but i want to sort records only date wise not datetime wise.

Posted 6 months ago by gurvindersingh

created_at is stored as 2019-02-11 18:28:42 but i want to sort my data according to date only from this field.

Query is as shown below:-

$data_rem = Reminder::all()->where('user_id',Auth::user()->id)->where('is_done','0')->where('is_temp_delete','0')->sortByDesc('created_at')->sortBy('priority');

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