4

I'm using Laravel 5.2. Below is one example of url() usage in one of my view (blade) file:

<form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}">
..
..
</form>

It returns me non-https urls like: http://www.example.com/register

I need it to be HTTPS. I'm already using valid HTTPS on my Website.

In my .env file, it is already:
APP_URL=https://www.example.com

In my config/app.php, it is already:
'url' => env('APP_URL', 'https://www.example.com'),

So what else do i need to configure for the LV 5.2 to return the HTTPS urls via url() helper function please?

Thank you.

1 Answer 1

9

Instead of url() you can simply use secure_url()

<form class="form-horizontal" role="form" method="POST" action="{{ secure_url('/register') }}">
..
..
</form>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.