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

saidu's avatar
Level 1

Publication date not show in the Edit page

After creating a blog post successfully when i try to update the all the other column data are passed except the published_at if i enter the date manually it gives this error "InvalidArgumentException Data missing " and if i just click on the draft it will save without error

Edit page>

 <div class="box-body">
         <div class="from-group {{ $errors->has('published_at')  ? 'has-error' : '' }}">
                {!! Form::label('published_at','Published Date') !!}
   {!! Form::text('published_at', null, ['class'=>'form-control datepicker-here ', 'placeholder' => 'Y-m-d H:i', 'id' => 'date' ]) !!}

                 @if($errors->has('published_at'))
  <span class="help-block">{{$errors->first('published_at')}}</span>
                                @endif
                            </div>
                        </div>

                        <div class="box-footer clearfix">
                            <div class="pull-left">
                                <a id="draft-btn" href="" class="btn btn-default">Draft</a>
                            </div>
                            <div class="pull-right">
                                {!! Form::submit('Publish', ['class'=>'btn btn-primary']) !!}
                            </div>
                        </div>
                    </div>
                </div>
                {!! Form::close() !!}
            </div>
            <!-- ./row -->
        </section>
        <!-- /.content -->
    </div>
@endsection

script

    <script type="text/javascript">
        $('#draft-btn').click(function (e) {
            e.preventDefault();
            $('#published_at').val("");
            $('#post-form').submit();
        });
</script>
@stop

Create Page

<td width="70">
                {!! Form::open(['method'=>'DELETE', 'route' =>['blogs.destroy', $post->id]]) !!}
                <a title="Edit" class="btn btn-xs btn-default edit-row" href="{{route('blogs.edit', $post->id)}}">
                    <i class="fa fa-edit"></i>
                </a>

                <button class="btn btn-xs btn-danger delete-row" href="{{route('blogs.destroy', $post->id)}}">
                    <i class="fa fa-trash"></i>
                </button>
                {!! Form::close() !!}
            </td>

Don't know what i'm doing wrong here. please help

0 likes
3 replies
Snapey's avatar

Your date field is probably expecting to be passed the seconds

The error "InvalidArgumentException Data missing" is from Carbon. It cannot parse the string you are sending from the form.

Please or to participate in this conversation.