Level 50
Show the full code where you're running the validation and checking its result.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
This is my code :
$input = [
'user_id' => Auth::id(),
'date' => null,
'timestamp_demande' => now(),
'timestamp_modification' => now(),
'statut' => $demande['statut'],
];
$validator = Validator::make($input, [
'user_id' => 'required',
'date' => 'required|date|date_format:Y-m-d',
'timestamp_demande' => 'required',
'timestamp_modification' => 'required',
'statut' => 'required',
]);
Why the validator is ok whereas the 'date' field is null ?
Regards
Please or to participate in this conversation.