app/Http/Controllers/Admin/UsersController.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)
    {
        $user->roles()->sync($request->roles);
        $user->fname = $request->fname;
        $user->lname = $request->lname;
        $user->email = $request->email;
        if ($user->save()){
            $request->session()->flash('success', $user->fname . ' ' . $user->lname .' has been updated');
        } else {
            $request->session()->flash('error', 'There was an error updating the user');
        }
        return redirect()->route('admin.users.index');
    }
public function update ( Request $ request , User $ user ) { $ user -> roles ( ) -> sync ( $ request -> roles ) ; $ user -> fname = $ request -> fname ; $ user -> lname = $ request -> lname ; $ user -> email = $ request -> email ; if ( $ user -> save ( ) ) { $ request -> session ( ) -> flash ( 'success' , $ user -> fname . ' ' . $ user -> lname . ' has been updated' ) ; } else { $ request -> session ( ) -> flash ( 'error' , 'There was an error updating the user' ) ; } return redirect ( ) -> route ( 'admin.users.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .