KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Not getting how to encrypt password during new resource create #2446

Open Rajaram Panda opened this topic on on Nov 19, 2021 - 3 comments

Rajaram Panda commented on Nov 19, 2021

Hi, I am using koolreprt dashboard and resource to manage our admin controls on db tables, And we have added koolreport in laravel, In case of users resource I am not able to send encrypted password before saving to db. Is there any way I cam encrypt manually? This is how I am now using password field

Text::create("password")
                ->validators([
                    RequiredFieldValidator::create()
                        ->errorMessage("Please enter a valid password"),
                ])
                ->showOnIndex(0)
                ->sortable(true),
KoolReport commented on Nov 21, 2021

Hi Rajaram,

Sorry for my late reply.

Please upgrade to Dashboard version 3.3.0, you will have a Password field to be used.

Password::create("password")
                ->validators([
                    RequiredFieldValidator::create()
                        ->errorMessage("Please enter a valid password"),
                ])
                ->processValueToDatabase(function($value){
                    return md5($value);
                })
                ->showOnIndex(0)
                ->sortable(true)

Here is the documentation for Password field.

Hope that helps.

If you need any further assistance, please let us know.

Anjali commented on Nov 22, 2021

Hello, I have used

->maskedText("********")

to display password in masked format, but when creating new record, it is shown as simple text instead of masked format. Also while editing, password field is shown blank instead of displaying existing value in password field.

KoolReport commented on Nov 22, 2021

It is the feature actually since this is admin panel so administrator is the one who set the password for user so if we hide password under a mask, the password could be run into typo issue, so better the password is shown on input.

In the edit, you are right that the password show empty instead of value in password field. This is because the password field is encrypted with hash function so there is no point to shown the hashed password there. That why we leave it just empty in update screen. If you leave the password field empty in update screen, it will not be updated to database. But if you enter a new password, it will encrypt and update the encrypted value to db.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Dashboard