I guess in your db it's a date format, or timestamp.
Use Carbon to format your date : https://carbon.nesbot.com/docs/
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello everyone, I am back with new problem again.I have a table called online.In that table i have added two entries which contains two date that is jan 25 2019 and jan 12 2019. So in the controller i have written query like this to fetch the dates.
public function pre(){ $dates = DB::table('online') ->select('online.date') ->distinct() ->get(); return view('admin.pre',compact('dates'));
i am displaying it in pre.blade.php like this
@foreach($dates as $date)
{{$date->date}} @endforeachSo i will get the output be like 25-1-2019 12-1-2019
I need to display those dates like "2019-01-25", "2019-01-12".Please help me to solve this problem
Please or to participate in this conversation.