0
I am trying to save Checklist data from protocol, but the following error is occurring at the time of saving:
Call to Undefined method Symfony Component Httpfoundation Parameterbag::save()
The following image shows the protocol’s Checklist model and the second image is the request variable debug. This debug shows how the data is structured.
Debug of the variable "request", data from the Checklist protocol modal. Yellow marked data are Checklist variables and red marked data is the id of the array item.
Loop responsible for displaying protocol Checklist data:
@foreach($checklistsProtocolos as $checklistProtocolo)
<tr>
<td><input type="text" class="form-control" id="item" name="item[]" value="{{$checklistProtocolo->item}}" size ="2"></td>
<td>{{$checklistProtocolo->descricao_item}}</td>
<input type="hidden" id="item_descricao_id" name="item_descricao_id[{{$checklistProtocolo->item}}][]" value="{{$checklistProtocolo->item_descricao_id}}">
<td><input type="checkbox" id="sim_nao" name="sim_nao[{{$checklistProtocolo->item}}][]" {{$checklistProtocolo->sim_nao == null ? '' : 'checked'}}></td>
<td><input type="checkbox" id="nao_atende" name="nao_atende[{{$checklistProtocolo->item}}][]" {{$checklistProtocolo->nao_atende == null ? '' : 'checked'}}></td>
<td><input type="date" id="dt_validade" name="dt_validade[{{$checklistProtocolo->item}}][]" value="{{$checklistProtocolo->dt_validade}}"></td>
<td><input type="text" id="pagina_documento" name="pagina_documento[{{$checklistProtocolo->item}}][]" value="{{$checklistProtocolo->pagina_documento}}" size ="1"></td>
<td><input type="text" id="observacao" name="observacao[{{$checklistProtocolo->item}}][]" value="{{$checklistProtocolo->observacao}}" size ="1" style="width: 300px; height: 60px"></td>
</tr>
@endforeach
Controller protocol Checklist registration method:
public function cadastroChecklistProtocolo(Request $request)
{
dd($request->request);
//Deletar a tabela de checklist_protocolo
$checklistsProtocolos = ChecklistProtocolo::where('projeto_id','=', $request->projeto_id)->delete();
//Recebe os dados do modal Checklist Protocolo
$checklistProtocolo = $request->request;
$checklistProtocolo->save();//está ocorrendo um problema no momento de salvar os dados
}
Are you sure that
$checklistsProtocolo
is a Model?– fernandosavio