Carbon get current date if variable is null

Viewed 11436

Inside my blade edit form, I have this:

<input type="text" name="birth" class="form-control" id="birth" value="{{ \Carbon\Carbon::parse($associado->birth)->format('d/m/Y') }}">

The problem is: if $associado->birth is NULL in database, Carbon is returning current date.

What can I do to avoid that?

3 Answers
Related