app/Http/Controllers/MensualiteController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request, Eleve $elefe)
    {
        $data = request()->validate([
          'mois' => 'required',
          'net_a_payer'=> 'required',
          'montant_verser' => 'required',
          'montant_restant' => 'required',
          'niveau'=> 'required',
        ]);
        $data = array_merge($data, ['eleve_id'=>$elefe->id]);
        Mensualite::create($data);
        return redirect('/eleves/'.$elefe->id);
    }
public function store ( Request $ request , Eleve $ elefe ) { $ data = request ( ) -> validate ( [ 'mois' => 'required' , 'net_a_payer' => 'required' , 'montant_verser' => 'required' , 'montant_restant' => 'required' , 'niveau' => 'required' , ] ) ; $ data = array_merge ( $ data , [ 'eleve_id' => $ elefe -> id ] ) ; Mensualite :: create ( $ data ) ; return redirect ( '/eleves/' . $ elefe -> id ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .