Missing required parameters for [Route:] [URI: / {} /]

3

I'm trying to pass an update parameter, but this is giving error.

Controller

public function update(ColaborationFormRequest $request, $id
{
    $dataForm = $request->all();
    $colaboration = $this->colaboration->find($id);
    $update = $colaboration->update($dataForm);
    if ($update)
        return redirect()->route('colaboradores.index');
    else
        return redirect()->route('colaboradores.edit', $id)
                         ->with(['errors' => 'Falha ao editar']);
}

Route

Route::resource('/colaboradores', 'RH\ColaborationController', [
'names' => [
    'index'     => 'colaboradores',
    'create'    => 'colaboradores.create',
    'edit'      => 'colaboradores.edit',
    'update'    => 'colaboradores.update',
]]);

View

{!! Form::open(['route' => 'colaboradores.update']) !!}
    <fieldset>
        <div class="card">
            <h5 class="card-header dark"><i class="fas fa-user"></i> Dados pessoais</h5>
            <div class="card-body">
                <div class="row">
                    <div class="form-group col-md-6">
                        {{ Form::label('nome', 'Nome: ') }} 
                        {{ Form::text('nome', null, ['class'=>'form-control'])}}
                    </div>
                </div>
    
asked by anonymous 20.12.2018 / 15:36

1 answer

2

I changed the way to call the route and it worked out

From

{!! Form::open(['route' => 'colaboradores.update']) !!}

For

{{ Form::open(['route.name' => 'colaboradores.update']) }}
    
20.12.2018 / 17:16