Such kind of issue occurs when a Laravel application tries to load cached configuration. If your application have all ok in .env file and config.php file, then this issue can be solved by clearing cached configuration.

You can use following command to clear configuration.

php artisan config:clear

Note: If you have any better solution, comment below.