where did you dream up this rule from?
try
"time" => 'required|date_format:H:i',
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello guys please I need some help with this laravel error "Method Illuminate\Validation\Validator::validateTime does not exist."
This is my Controller
public function expectingpost(Request $request)
{
DB::table('expectings') ->insert([
$validatedData = $request->validate([
"time" => 'required|time_format:00:00',
"day" => 'required|date_format:d/m/Y',
"name" => 'required|name'
]).
"time" => $request->time,
"day" => $request->date,
"name" => $request->name
]);
return back() -> with('expecting', $request->input('name') . ' has been added as your guest');
}
}
And also my blade.php
<form action="{{route('expecting.post')}}" method="post" class="expecting-form">
@csrf
@error('time')
<div class="alert alert-danger" style="width: 100%;">
<span>{{$message}}</span>
</div>
@enderror
@error('day')
<div class="alert alert-danger" style="width: 100%;">
<span>{{$message}}</span>
</div>
@enderror
@error('name')
<div class="alert alert-danger" style="width: 100%;">
<span>{{$message}}</span>
</div>
@enderror
<div class="col-md-12">
<label for="time" class="form-label"><strong>Time of Visit</strong></label>
<input type="time" class="form-control" name="time" id="time" placeholder="Time of Visit">
</div>
<br>
<div class="col-md-12">
<label for="date" class="form-label"><strong>Day of Visit</strong></label>
<input type="date" class="form-control" name="date" id="date" placeholder="Day of Visit">
</div>
<br>
<div class="col-md-12">
<label for="name" class="form-label"><strong>Name of Person</strong></label>
<input type="text" class="form-control" id="name" name="name" placeholder="Name of Person">
</div>
</div>
<div class="modal-footer col-11 mx-auto">
<button type="submit" class="btn btn-confirm text-white"><b>OK</b></button>
</div>
</form>
Please I seriously need help. Thank you
Please or to participate in this conversation.