To remove the time from the date, you can use the format() method of the Carbon library. First, you need to convert the datetime string to a Carbon instance, and then format it to display only the date part. Here's an example:
use Carbon\Carbon;
// convert datetime string to Carbon instance
$date = Carbon::parse($competition->start_date);
// format the date to display only the date part
$formattedDate = $date->format('Y-m-d');
// display the formatted date in your view
<input name="start_date" type="date" value="{{ $formattedDate }}" class="form-control @error('start_date') is-invalid @enderror" id="inputStart_date" placeholder="Enter Start Date">
In this example, we first use the parse() method of the Carbon library to convert the datetime string to a Carbon instance. Then, we use the format() method to format the date in the desired format, which is Y-m-d (year-month-day). Finally, we display the formatted date in the input field.
To display the formatted date in your table, you can use the same format() method in your view:
<td>{{ $competition->start_date->format('Y-m-d') }}</td>
This will display only the date part of the datetime string in your table.