Replies: 5 comments
-
again: $config['key'] is really null - all other array member are okay ! |
Beta Was this translation helpful? Give feedback.
-
Hi @susanne99, I assume you already tried to run: Can you check config/app.php There must be a line as:
If it's missing add it and try it again please. Additionally laravel caches configuration files for performance. If the cache contains old or invalid configuration, it might lead to issues. Try cleanup the cache: php artisan config:cache
php artisan cache:clear |
Beta Was this translation helpful? Give feedback.
-
I've gone through everything - I'm not a newbie - sorry - thanks for the help anyway
Gesendet: Dienstag, 27. August 2024 um 21:53 Uhr
Von: "Ulaş" ***@***.***>
An: "laravel/framework" ***@***.***>
Cc: "susanne99" ***@***.***>, "Mention" ***@***.***>
Betreff: Re: [laravel/framework] EncryptionServiceprovider->key(array $config): APP_KEY sometimes null (Discussion #52584)
Hi @susanne99,
I assume you already tried to run:
php artisan key:generate
Can you check config/app.php
There must be a line as:
'key' => env('APP_KEY'),
If it's missing add it and try it again please.
Additionally laravel caches configuration files for performance. If the cache contains old or invalid configuration, it might lead to issues. Try cleanup the cache:
php artisan config:cache
php artisan cache:clear
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
here the code where th eerror occurs: file: \vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php ` protected function registerEncrypter()
after this command $config = $app->make('config')->get('app'); not always, that is the problem ! |
Beta Was this translation helpful? Give feedback.
-
why isn't there more going on here - I'm here at Laravel, right? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
11.19.0
PHP Version
8.3.10
Database Driver & Version
No response
Description
I use Laravel 11 as the backend for the middleware.
Frontend is a SPA VUE application.
For authentication I use Laravel Sanctum.
Problem description: It is very common for the middleware to have the following error:
There is no APP_KEY defined.
That's wrong, otherwise it would never work.
However, I noticed that in the class "EncryptionServiceProvider" the method "key" with "$config" as a parameter, where the "key" member is really "null".
The interesting thing is that all other .env (APP_) entries are there, only the "key" entry is null !!!!
What's going on - unfortunately this makes the application completely unstable and unusable
protected function key(array $config) { return tap($config['key'], function ($key) { if (empty($key)) { throw new MissingAppKeyException; } }); }
Steps To Reproduce
sorry, if i could reproduce the error, then can i fix it
Beta Was this translation helpful? Give feedback.
All reactions