Level 4
You can get date as
$PhoneBooking->created_date->toDateString()
and time as
$PhoneBooking->created_date->toTimeString()
Go to carbon documentation you will get to know a lot about manipulating dates
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i need to get the date and time sepratly from timestap of created at colum to show on my show.details.blade.php
<div class="row">
<div class="col-md-6">
<span class="col-md-2">Time: </span>
<span class="col-md-4">{{$PhoneBooking->created_date}}</span>
</div>
controller
public function show($id)
{
$PhoneBooking = PhoneBooking::find($id);
return view('booking.showBooking',compact('PhoneBooking'));
// return "V";
}
You can get date as
$PhoneBooking->created_date->toDateString()
and time as
$PhoneBooking->created_date->toTimeString()
Go to carbon documentation you will get to know a lot about manipulating dates
Please or to participate in this conversation.