Closed Astelll closed 2 years ago
Somewhere, it's passing null
to the constructor of StringProvider
. This usually happens when something was expected to be defined, but it isn't.
StringProvider
is strictly typed. This is probably a configuration issue with the laravel-ciphersweet package.
Somewhere, it's passing
null
to the constructor ofStringProvider
. This usually happens when something was expected to be defined, but it isn't.
StringProvider
is strictly typed. This is probably a configuration issue with the laravel-ciphersweet package.
Thank you for your answer Can I make a screenshot of your anwser and use it in in that thread?
Sure
If you should written step of generating key (2. Generating the encrypting key) before publishing configuration line, So issue will not come like this
ParagonIE\CipherSweet\KeyProvider\StringProvider::__construct(): Argument #1 ($rawKey) must be of type string, null given, called in /var/www/html/riview_app/vendor/spatie/laravel-ciphersweet/src/LaravelCipherSweetServiceProvider.php on line 74
I'm not sure that I'm asking in the right place, but I want to understand and solve the problem, so I'll write it here anyway.
I installed to my project developed with Laravel framework this library https://github.com/spatie/laravel-ciphersweet, which implements Ciphersweet use within Laravel, and tried to encrypt data in my DB with this command
php artisan ciphersweet:encrypt "App\Models\User" da61321c8814fe47f6f647f26330bc34f88fd8c32c1df25af4f0b3a30dff00e9
, but got errorParagonIE\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
on line 48-55 I see this code:and then if I go to StringProvider I see
I tried to google why PHP see empty string as null, but without success, and I'm not sure that this is the problem.
What am I doing wrong and how can I try to fix it? As I see, no one has ansered to my question in that thread, so maybe only me got this error, and maybe I don't know some basics.
I would appreciate your help.