In the view:
{!! Form::model($evento,['route'=>['eventos.update',$evento->id], 'method'=>'PUT','files'=> true])!!}
@include('eventos.form.editar')
{!! Form::submit('Editar',['class'=>'btn btn-primary']) !!}
{!! Form::close() !!}
In the controller:
public function update($id, Request $request)
{
$evento = Evento::find($id);
$evento->fill($request->all());
$evento->save();
Session::flash('mensaje','Evento editado Correctamente');
return Redirect::to('eventos');
}
On the route:
Route::resource('eventos','EventoController');
I get the following error:
FatalThrowableError in EventoController.php line 54:
Type error: Too few arguments to function App\Http\Controllers\EventoController::update(), 1 passed and exactly 2 expected
The id seems to send it but the request does not ... I do not know why that happens ...