Closed susanne99 closed 3 months ago
This is a support question and not a bug. Please don't re-open closed issues and attempt a support channel instead:
It's a mistake, believe it or not. No matter, PHP is not suitable for productive use anyway. You're not harming me - I'm just laughing
Laravel Version
11.19.0
PHP Version
8.3.10
Database Driver & Version
No response
Description
(hint: Don't move it to discussion area, it is a BUG !!!!!!!!!!!!!!)
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 happens sometimes, during the app runs, that the "appkey" is not 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; } }); }
**here the code where th error occurs: file: \vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php
` protected function registerEncrypter() { $this->app->singleton('encrypter', function ($app) { $config = $app->make('config')->get('app');
}`** after this command $config = $app->make('config')->get('app'); the $config['key'] is null or empty
Important Hint: $config['key'] is not always null, and it is the only only member of config that is destroyed !!!!!!!!!!!!!!!!!
laravel runs on windows 10 with latest XAMPP
Steps To Reproduce
sorry, if i could reproduce the error, then can i fix it