0

I have a blade template that includes a form and the forms action is a Laravel route with a name.

<form method="POST" action="{{ route('send-email') }}">

When this is compiled on my webpage the route is http but I want it to be https e.g.

<form method="POST" action="http://myexamplesite.com/send-email">

How can I change it so it always uses https?

like: <form method="POST" action="https://myexamplesite.com/send-email">

My routes file:

Route::post('send-user-email', 'SendUserEmailController@store')->name('send-email');

user2953989
  • 2,791
  • 10
  • 36
  • 49
  • https://stackoverflow.com/questions/35827062/how-to-force-laravel-project-to-use-https-for-all-routes https://stackoverflow.com/questions/28402726/laravel-5-redirect-to-https – user3532758 Aug 23 '21 at 15:41

2 Answers2

0

in your .env file define your url with https:

APP_URL=https://yoursite.com
Behzad
  • 532
  • 6
  • 18
-1

Laravel basically appends the routes to the app URL from your .env file, so to make changes you need to add HTTPS in APP_URL of in the .env file of your project

Example APP_URL=https://mycoolsite.org

Krish Yadav
  • 165
  • 11