Lumen 5.5.2 URL forceSchema not working at all

5.3k Views Asked by At

I am using Lumen 5.5 and using the following code chunk under app/providers/appServiceProvider.php in boot method.

\URL::forceSchema('https');

It was compatible with the earlier version of Lumen 5.2

Is there any way to sort this out without using mod_rewrite and middleware approaches.

2

There are 2 best solutions below

0
Andrei Zisu On

It appears the function has changed name from forceSchema to forceScheme.

0
Gufran Hasan On

You are using Lumen 5.2.

In Laravel 5.2 or earlier version it was working fine.

\URL::forceSchema('https');

In Laravel 5.4 or above version it changed to

\URL::forceScheme('https');