I am getting the following error code
Creating default object from empty value
When I dump the $post it returns null, however when I dump $id it returns the ID.
The controller code is as follows:
public function update(Request $request, $id)
{
$this->validate($request, array (
'post' => '',
'mailbox' => '',
'conum' => '',
'prefix' => '',
'telans' => '',
'TC' => 'required',
));
//store
$post = Customers::find($id);
dd($id);
$post->post = $request->input('post');
$post->postpro = $request->input('mailbox');
$post->telans = $request->input('telans');
$post->conum = $request->input('conum');
$post->prefix = $request->inut('prefix');
$post->tc = $request->input('TC');
//save
$post->save();
//session flash message
//Session::flash('success','This customer has now been added');
//redirect
return redirect('/home');}
The form in the index file is as follows
{!! Form::model('Customers', ['route'=>['products.update', Auth::user()->id],'method' => 'PUT']) !!}
{{ Form::hidden('business', Auth::user()->name, array('class' => 'form-control', 'required' => '','maxlength'=>'255'))}}
{{ Form::label('post', 'Mailbox')}}
{{ Form::checkbox('post',1, 0, array('class' => 'form-control'))}}
<div id="extra_form">
{{ Form::label('mailbox', 'Mailbox Option')}}</br>
{{ Form::select('mailbox', array('rolling' => 'Rolling','month' => 'Monthly','year' => 'Yearly'), 'null', array('class' => 'form-control'))}}
</div>
{{ Form::label('conum', 'Company Number')}}
{{ Form::checkbox('conum',1, 0, array('class' => 'form-control'))}}
<div id="extra_form1">
{{ Form::label('prefix', 'Preferred number prefix')}}
{{ Form::tel('prefix', 0, array('class' => 'form-control'))}}
</div>
{{ Form::label('telans', 'Telephone Answering')}}
{{ Form::checkbox('telans',1, 0, array('class' => 'form-control'))}}
<hr>
<div id="extra_form3">
{{ Form::label('posttc', 'Mailbox Terms and Conditions')}}</br>
Click here
</div>
<div id="extra_form2">
{{ Form::label('conumtc', 'Company Number Terms and Conditions')}}</br>
Click here
</div>
<div id="extra_form4">
{{ Form::label('telanstc', 'Telephone Answering Terms and Conditions')}}</br>
Click here
</div>-->
{{ Form::label('TC', 'I accept the Office Flex terms and conditions.')}}
{{ Form::checkbox('TC',1, 0, array('class' => 'form-control','required'=>''))}}
{{ Form::submit('Select Product', array('class' => 'btn btn-success', 'id' => 'create_btn'))}}
{!! Form::close() !!}
idyou're passing?