app/Http/Controllers/HomeController.php
/**
     * Change user password
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
Change user password
@return \Illuminate\Contracts\Support\Renderable
Change user password @return \ Illuminate \ Contracts \ Support \ Renderable
public function changePassword(Request $request)
    {
        $data = $request->all();
        if(Hash::check($data['oldPassword'], auth()->user()->password)) {
            if($data['newPassword'] == $data['rePassword']) {
                $this->user->find(auth()->id())->update([
                    'password' => Hash::make($data['newPassword'])
                ]);
                return redirect()->route('show-profile')->withSuccess(['Password berhasil diganti!']);
            }
        }
        return redirect()->route('show-profile')->withError(['Password gagal diganti!']);
    }
public function changePassword ( Request $ request ) { $ data = $ request -> all ( ) ; if ( Hash :: check ( $ data [ 'oldPassword' ] , auth ( ) -> user ( ) -> password ) ) { if ( $ data [ 'newPassword' ] == $ data [ 'rePassword' ] ) { $ this -> user -> find ( auth ( ) -> id ( ) ) -> update ( [ 'password' => Hash :: make ( $ data [ 'newPassword' ] ) ] ) ; return redirect ( ) -> route ( 'show-profile' ) -> withSuccess ( [ 'Password berhasil diganti!' ] ) ; } } return redirect ( ) -> route ( 'show-profile' ) -> withError ( [ 'Password gagal diganti!' ] ) ; }
Change user password
 @return \Illuminate\Contracts\Support\Renderable
Change user password @return \ Illuminate \ Contracts \ Support \ Renderable