Nếu bạn đang làm 1 form submit trên web và bông dưng gặp thông báo này.
This form is not secure. Autofill has been turned off
Lý do là action của bạn đang post sang 1 http chứ không phải là https
Vậy giở bạn phải làm sao?
The code you’ve written in the boot()
method of your AppServiceProvider
<?php namespace App\Providers; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Register any application services. */ public function register(): void { // } /** * Bootstrap any application services. */ public function boot(): void { if($this->app->environment('production')) { \URL::forceScheme('https'); } } }
Và sau đó khi bạn start app thì thêm environment này vào: APP_ENV=production hoặc thêm vào file .env