Date update in Laravel

1

I'd like to change the value of the date field at the time of a data edit. I can bring all the values except the date.

I'm using Laravel's Form :: :

{!! Form::label('dtemissao','Data de Emissão') !!}
{!! Form::input('date','dtemissao',$FinContaspagar[0]["DtEmissao"]->format("d/m/Y"), ['class' => 'form-control']) !!}<br />

I'm using $FinContaspagar[0]["DtEmissao"]->format("d/m/Y") to change the default value of dd / mm / yyyy , but I was not successful at changing the value.

Does anyone have a solution?

    
asked by anonymous 12.04.2017 / 19:25

1 answer

1

Use the format: Y-m-d , example:

<input type="date" value="{{$data->format('Y-m-d')}}">

in your code:

{!! Form::label('dtemissao','Data de Emissão') !!}
{!! Form::input('date','dtemissao',$FinContaspagar[0]["DtEmissao"]->format('Y-m-d')) !!}
    
12.04.2017 / 22:20