Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Steady-Entertainment's avatar

date input field birthday

I want to insert something into my database blade file

<div>
          <input wire:model.lazy="birthday" name="birthday" type="date" required class="" placeholder="Birthday">
</div>

migration file

$table->date('birthday');

can i use this html type date? cause it is not supported by safari?!

is this compatible ?

0 likes
1 reply
rodrigo.pedra's avatar
Level 56

It is not supported on desktop Safari, on mobile Safari it is supported (actually mobile Safari introduced this input type).

On desktop Safari, or any other browsers that do not support this input type, what will happen is that it will be rendered as regular <input type="text" ...>. No problem whatsoever as long your users fill the date in the ISO format ('yyyy-mm-dd')

What I usually do to hint users using browsers that don't support date inputs is adding the placeholder, pattern and title attributes to hint how they should fill that field

<input wire:model.lazy="birthday" name="birthday" 
    type="date" required class="" 
    placeholder="yyyy-mm-dd" pattern="\d{4}-\d{2}-\d{2}" 
    title="Provide a date in the format yyyy-mm-dd">

Hope it helps.

2 likes

Please or to participate in this conversation.