Settings icon indicating copy to clipboard operation
Settings copied to clipboard

Add settings easily from admin panel with improvements to handle upload image field

Open iMokhles opened this issue 7 years ago • 11 comments

i have been thinking about this pull request from the first time i used this package but i hadn't really time to do it but now it's done i hope it will be useful and improve the usage of this awesome package

How to use

  1. admin create the settings field he need and click save capture d ecran 2018-01-24 a 14 06 11

  2. if he selected for example image field ( it will be empty inside the list page ) capture d ecran 2018-01-24 a 14 06 17

  3. admin now can click edit button and he will find the field he selected from the create page capture d ecran 2018-01-24 a 14 06 29

  4. now if it's image as we set before i have setup configurations for configure almost everything for image field and if cropper enabled etc the image will appear normally and use can save it capture d ecran 2018-01-24 a 14 06 41

that's all and here's a list of supported field

[
 'text' => 'Text',
 'email' => 'Email',
 'checkbox' => 'Checkbox',
 'number' => 'Number',
 'url' => 'URL',
 'image' => 'Image',
 'password' => 'Password',
 'icon_picker' => 'Icon Picker',
]

and here's how it appears in list page capture d ecran 2018-01-24 a 13 59 39

iMokhles avatar Jan 24 '18 13:01 iMokhles

nice :)

It would be good if settings are stored in json as well :)

shirshak55 avatar Feb 14 '18 17:02 shirshak55

@bloggervista hey i don't encourage that specially for keys and passwords etc but we can make it optional ;)

iMokhles avatar Feb 14 '18 17:02 iMokhles

@iMokhles password can be encrypted using bcrypt like normal :)

shirshak55 avatar Feb 14 '18 18:02 shirshak55

@bloggervista bcrypt() for hashing so we cannot reverse it into their plain text again, but yes we can encrypt passwords and decrypt them if needed using Crypt

use Illuminate\Support\Facades\Crypt;
$encrypted = Crypt::encryptString('Hello world.');
$decrypted = Crypt::decryptString($encrypted);

source

iMokhles avatar Feb 14 '18 18:02 iMokhles

@iMokhles password are never means to be decrypted isn't it? Am i wrong here?

shirshak55 avatar Feb 14 '18 18:02 shirshak55

@bloggervista sometimes we need to decrypt passwords ( which we use for external API calls ) in my case i have my Apple Developer Account credentials saved to my database and password is encrypted and once i need to call apple's api to authenticate my request i decrypt this password before passing it with my request

iMokhles avatar Feb 14 '18 18:02 iMokhles

I'm getting lost in the discussion about password encrypting and decrypting.

lloy0076 avatar Feb 16 '18 17:02 lloy0076

hey sorry for taking so long time to answer you @lloy0076 , in my case i was talking about password ( which means API keys for real password for social accounts ).

example: my facebook account credentials: Email: [email protected] Password 123456 so i don't want saving this password as plain text like that ( i need to encrypt it ) and saved the encrypted text to database, and once i call this encrypted password i can decrypt it to reverse it back to plain text it's some sort of protection and make it more privately so anyone get access to database don't see the plain password and won't be able to decrypt it because i'm the only has the decryption key..

iMokhles avatar Apr 05 '18 18:04 iMokhles

what if he(hacker) gets decryption keys?

shirshak55 avatar Apr 05 '18 18:04 shirshak55

@bloggervista he won't get it because the key is hardcoded inside PHP which in the server side and won't be rendered to html output after the server send it to the browser, unless your server got hack and he got access to all your PHP source codes files. ( that's the only way ( i ) know to get this key from your PHP code )

iMokhles avatar Apr 06 '18 01:04 iMokhles

@tabacitu @iMokhles Hi guys, just asking, how's the progress with this PR? Will it be merged or is there any additional issue needed to be resolved?

drionix avatar Feb 01 '20 11:02 drionix