在laravel 5中自动获取当前日期

I want to display todays date in date_created field when clicked to create page.

{!! Form::open(['route'=>'articles.store'])!!}
        <div class="form-group">
           <label><b>DATE CREATED</b></label>
           {!! Form::text('date_created',null,array('class'=>'form-control date-picker')) !!}
        </div>
        {!! form::submit('Add',[' class'=>'btn btn-primary form-control'])!!}
{!! Form::close()!!}

You can use

{!! Form::text('date_created', 
    old('date_created', 
        Carbon\Carbon::today()->format('Y-m-d')),
    ['class'=>'form-control date-picker']) !!}

Just pass the value -

{!! Form::text(
    'date_created',
    date('Y-m-d'),
    array('class'=>'form-control date-picker')
) !!}

DOCS

Use Carbon for time and date purpose in Laravel

Carbon is officially supported by Laravel

Here's how you can print today's date with Carbon.

{!! Form::open(['route'=>'articles.store'])!!}
        <div class="form-group">
           <label><b>DATE CREATED</b></label>
           {!! Form::text('date_created',Carbon\Carbon::today()->toDateString(),array('class'=>'form-control date-picker')) !!}
        </div>
        {!! form::submit('Add',[' class'=>'btn btn-primary form-control'])!!}
{!! Form::close()!!}

You can use simple code, as follows:

{!! Form::input('date','start_date',date('Y-m-d'),['class' => 'form-control']) !!}

Instead of doing complex code. Aslo you need to add time zone in app.php file.

'timezone' => 'Asia/Kolkata',

(For India it is Asia/Kolkata)

After Laravel 5.5 you can use now() function to get the current date and time.

In blade file, you can write like this to get date.

{!! Form::text('date_created', 
    old('date_created', 
        now()->format('Y-m-d')),
    ['class'=>'form-control date-picker']) !!}

enter image description here