app/Http/Controllers/UserController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\User  $user
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, User $user)
    {
        $organization_id = $request->organization_id;
        unset($request['organization_id']);
        $user->update($request->all());
        $user->organizations()->detach();
        $user->organizations()->attach($organization_id);
        return $user;
    }
public function update ( Request $ request , User $ user ) { $ organization_id = $ request -> organization_id ; unset ( $ request [ 'organization_id' ] ) ; $ user -> update ( $ request -> all ( ) ) ; $ user -> organizations ( ) -> detach ( ) ; $ user -> organizations ( ) -> attach ( $ organization_id ) ; return $ user ; }
Update the specified resource in storage.
Update the specified resource in storage .