app/Http/Controllers/Admin/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(UserValidator $request, $id)
    {
        $request->validate([
            'email'=>'required',
            'role'=>'required',
            'name'=>'required',
            'password'=>'required',
            'status'=>'required'
           ]); 
        $user = User::findorfail($id);
        $password = Hash::make($request->password);
        $data['password'] = $password;
        $user->update($data);
        return redirect()->route('user.index')->with('success', 'User Updated Successfully');
    }
public function update ( UserValidator $ request , $ id ) { $ request -> validate ( [ 'email' => 'required' , 'role' => 'required' , 'name' => 'required' , 'password' => 'required' , 'status' => 'required' ] ) ; $ user = User :: findorfail ( $ id ) ; $ password = Hash :: make ( $ request -> password ) ; $ data [ 'password' ] = $ password ; $ user -> update ( $ data ) ; return redirect ( ) -> route ( 'user.index' ) -> with ( 'success' , 'User Updated Successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .