Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

iMokhles
Copy link
Contributor

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

@shirshak55
Copy link

nice :)

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

@iMokhles
Copy link
Contributor Author

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

@shirshak55
Copy link

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

@iMokhles
Copy link
Contributor Author

@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

@shirshak55
Copy link

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

@iMokhles
Copy link
Contributor Author

@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

@lloy0076
Copy link
Contributor

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

@iMokhles
Copy link
Contributor Author

iMokhles commented Apr 5, 2018

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..

@shirshak55
Copy link

shirshak55 commented Apr 5, 2018

what if he(hacker) gets decryption keys?

@iMokhles
Copy link
Contributor Author

iMokhles commented Apr 6, 2018

@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 )

@drionix
Copy link

drionix commented Feb 1, 2020

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants