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)
    {
        $validatedData = $request->validate([
            'username' => ['required','min:3', 'max:255'],
            'fullname' => 'required|max:255',
            'nim' => 'required|max:255',
            'email' => 'required|email:dns',
        ]);
        $updated = User::where('id', auth()->user()->id)->update($validatedData);
        $request->session()->flash('updated','Successfully Update the Data!');
        return redirect('/dashboard');
    }
public function update ( Request $ request , $ id ) { $ validatedData = $ request -> validate ( [ 'username' => [ 'required' , 'min:3' , 'max:255' ] , 'fullname' => 'required|max:255' , 'nim' => 'required|max:255' , 'email' => 'required|email:dns' , ] ) ; $ updated = User :: where ( 'id' , auth ( ) -> user ( ) -> id ) -> update ( $ validatedData ) ; $ request -> session ( ) -> flash ( 'updated' , 'Successfully Update the Data!' ) ; return redirect ( '/dashboard' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//  'password' => 'required|min:8|max:255'  //$validatedData['password'] = Hash::make($validatedData['password']); // User::where('id',auth()->user()->id) //     ->update($validatedData);