To remove the "00:00:00" from the date, you can use the PHP strtotime() function to convert the date string to a Unix timestamp, and then use the date() function to format the timestamp as a string without the time component. Here's an example:
public function store(Product $product, Warranty $warranty, Request $request)
{
$date = $request->post('new_date');
$timestamp = strtotime($date);
$date_without_time = date('Y-m-d', $timestamp);
dd($timestamp, $date_without_time);
}
In this example, we first retrieve the date string from the request without the "00:00:00" time component. We then use strtotime() to convert the date string to a Unix timestamp. Finally, we use date() to format the timestamp as a string without the time component, using the 'Y-m-d' format string.
Note that the resulting date string will be in the format 'YYYY-MM-DD'. If you need a different format, you can adjust the format string passed to date().