Replies: 4 comments 4 replies
-
I asked this question at https://github.com/paragonie/ciphersweet/ project in this thread, and got such answer: |
Beta Was this translation helpful? Give feedback.
-
Adding on to this - it seems you need to set the key in .env first, even though the docs say not to. It's looking for the value of the env key, and it's null until you set it. The instructions likely need to be updated. |
Beta Was this translation helpful? Give feedback.
-
@riasvdv could you have a look and update the readme if necessary? |
Beta Was this translation helpful? Give feedback.
-
I can confirm, just generating the key first (it does work), then copying that key to the env and then encrypt the model with the key like the docs mention works like a charm |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm trying to encrypt data in my database by command:
php artisan ciphersweet:encrypt <your-model-class> <generated-key>
php artisan ciphersweet:encrypt "App\Models\User" da61321c8814fe47f6f647f26330bc34f88fd8c32c1df25af4f0b3a30dff00e9
but I receive such error
ParagonIE\CipherSweet\KeyProvider\StringProvider::__construct(): Argument #1 ($rawKey) must be of type string, null given, called in /var/www/fastuser/data/www/api.dev.clanhall.net/vendor/spatie/laravel-ciphersweet/src/LaravelCipherSweetServiceProvider.php on line 52
What am I doing wrong and how can I try to fix it?
All instructions from readme were executed
Beta Was this translation helpful? Give feedback.
All reactions