protected function updateUserPorfile($data)
    {
        $data = $data->except('email');

        if ($data instanceof Collection) {
            $data = $data->toArray();
        }

        if (isset($data['password'])) {
            $data['password'] = Hash::make($data['password']);
        }

        Auth::user()->update($data);
    }
protected function updateUserPorfile($data)
    {
        $data = $data->except('email');

        if ($data instanceof Collection) {
            $data = $data->toArray();
        }

        if (isset($data['password'])) {
            $data['password'] = Hash::make($data['password']);
        }

        Auth::user()->update($data);
    }
protected function updateUserPorfile ( $ data ) { $ data = $ data -> except ( 'email' ) ; if ( $ data instanceof Collection ) { $ data = $ data -> toArray ( ) ; } if ( isset ( $ data [ 'password' ] ) ) { $ data [ 'password' ] = Hash :: make ( $ data [ 'password' ] ) ; } Auth :: user ( ) -> update ( $ data ) ; }
Updates the user profile with the given data.

@param  \Illuminate\Http\Request|Collection $data

@return void
Updates the user profile with the given data .