Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Another_X's avatar

Laravel is forcing https on my local enviroment

I have set redirect solution in my AppServiceProvider.php file

        if (!\App::environment('local')) {
          \URL::forceScheme('https');
        }

But now if I run php artisan config:cache, all environments are forcing https? What is causing this behavior?

0 likes
3 replies
rob897's avatar

That does the trick. I renamed all my .dev domains to .test and they all work again.

Another_X's avatar

Acctualy, that is what i thought, but i changed to .site. Problem is happening when i run cache command. Now i know i should not cache on development enviroment.

Please or to participate in this conversation.