fix: handle null validity date in ternary

This commit is contained in:
Corentin Huet 2025-09-15 15:22:47 +02:00
parent 15c7dae65c
commit 73fdf2f781
2 changed files with 4 additions and 1 deletions

3
.gitignore vendored
View file

@ -33,3 +33,6 @@ resources/theme
resource/vendor/mail/html/themes/default.css
auth.json
.npmrc
.zshrc
.npm/
.composer/

View file

@ -158,7 +158,7 @@
</div>
<div class="flex row">
<label for="certiphyto_date" class="form-control">Date de validité *</label>
<input type="date" name="certiphyto_date" placeholder="Date de validité *" value="{{ old('certiphyto_date', isset($customer) ? $customer->certiphyto_date->format('Y-m-d') : null) }}">
<input type="date" name="certiphyto_date" placeholder="Date de validité *" value="{{ old('certiphyto_date', isset($customer->certiphyto_date) ? $customer->certiphyto_date->format('Y-m-d') : null) }}">
</div>
<div class="flex row">
@foreach ($errors->get('certiphyto_date') as $message)