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