The problem is an undefined variable `stg` in the view. My controller:

```
public function editstg($id)
{
  $stg= Stgeffectue::find($id);
  return view('frontend.editstage',['stg'=>$stg]);
} 

public function updatestg(Request $request, $id)
{
  $stg = Stgeffectue::find($id);

  $stg->nom_stg=$request->input('nom_stg');
  $stg->lieu_stg=$request->input('lieu_stg');
  $stg->details_stg=$request->input('details_stg');

  $stg->save();

  return redirect('stage_effectues');
}

```

and this is my view code

```html
<form action=" {{ action('StgeffectueController@updatestg', $stg->id) }}" method="post">
    {{ csrf_field() }}
    <input type="submit" name="submit" value="Enregistrer" class="form-control btn btn-sm btn-icon btn-primary">
    <label class="col-form-label col-md-4">Nom Stage :</label>
    <input class="form-control" type="text" name="nom_stg" value="{{ $stg->nom_stg}}" />

```

The route code:

```
Route::get('/editstage/{id}','StgeffectueController@editstg');
Route::put('/editstage/{id}','StgeffectueController@updatestg');

```