app/Http/Controllers/UsersController.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(UserRequest $request, $id)
    {
        $user = User::find($id);
        $user->fill($request->all());
        $user->save();
        flash('The user '.$user->name.' was updated')->success()->important();
        return redirect()->route('users.index');
    }
public function update ( UserRequest $ request , $ id ) { $ user = User :: find ( $ id ) ; $ user -> fill ( $ request -> all ( ) ) ; $ user -> save ( ) ; flash ( 'The user ' . $ user -> name . ' was updated' ) -> success ( ) -> important ( ) ; return redirect ( ) -> route ( 'users.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// /*
        the previous line replace the following code.
        $user->name=$request->name;
        $user->email=$request->email;
        $user->type=$request->type;
        */