app/Http/Controllers/InvitationsController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $invitation = Invitation::find($id);
        $invitation->statut = 1;
        $invitation->save();
        if($invitation){
            ParticipeSalon::create([
                'user_id'   => Auth::id(),
                'salon_id'  => $invitation->salon_id,
                'moderateur'    => 0,
                'statut'        =>0
            ]);
        }
        return redirect()->route('invitations.show', $invitation->id);
    }
public function update ( Request $ request , $ id ) { $ invitation = Invitation :: find ( $ id ) ; $ invitation -> statut = 1 ; $ invitation -> save ( ) ; if ( $ invitation ) { ParticipeSalon :: create ( [ 'user_id' => Auth :: id ( ) , 'salon_id' => $ invitation -> salon_id , 'moderateur' => 0 , 'statut' => 0 ] ) ; } return redirect ( ) -> route ( 'invitations.show' , $ invitation -> id ) ; }
Update the specified resource in storage.
Update the specified resource in storage .