app/Http/Controllers/UserController.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)
    {
        $user = User::find($id);
        $user->firstname = $request->input('firstname');
        $user->lastname = $request->input('lastname');
        $user->email = $request->input('email');
        $user->department_id = $request->input('department_id');
        $user->save();
        return redirect()->route('users.index');
    }
public function update ( Request $ request , $ id ) { $ user = User :: find ( $ id ) ; $ user -> firstname = $ request -> input ( 'firstname' ) ; $ user -> lastname = $ request -> input ( 'lastname' ) ; $ user -> email = $ request -> input ( 'email' ) ; $ user -> department_id = $ request -> input ( 'department_id' ) ; $ user -> save ( ) ; return redirect ( ) -> route ( 'users.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .