app/Http/Controllers/MensualiteController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Mensualite  $mensualite
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Mensualite $mensualite)
    {
        $data = request()->validate([
            'mois' => 'required',
            'net_a_payer'=> 'required',
            'montant_verser' => 'required',
            'montant_restant' => 'required',
            'niveau'=> 'required',
          ]);
          $mensualite->update($data);
          return redirect('/mensualites/'.$mensualite->id);
    }
public function update ( Request $ request , Mensualite $ mensualite ) { $ data = request ( ) -> validate ( [ 'mois' => 'required' , 'net_a_payer' => 'required' , 'montant_verser' => 'required' , 'montant_restant' => 'required' , 'niveau' => 'required' , ] ) ; $ mensualite -> update ( $ data ) ; return redirect ( '/mensualites/' . $ mensualite -> id ) ; }
Update the specified resource in storage.
Update the specified resource in storage .