Sometimes, we want to redirect to HTTPS with Laravel 5 and PHP.
In this article, we’ll look at how to redirect to HTTPS with Laravel 5 and PHP.
How to redirect to HTTPS with Laravel 5 and PHP?
To redirect to HTTPS with Laravel 5 and PHP, we can use the \URL::forceScheme
method.
For instance, we write
\URL::forceScheme("https");
to call \URL::forceScheme
with "https"
to force the app to be served over https.
Conclusion
To redirect to HTTPS with Laravel 5 and PHP, we can use the \URL::forceScheme
method.