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
![](https://nimtechnology.com/wp-content/uploads/2024/04/image-26.png)
Lý do là action của bạn đang post sang 1 http chứ không phải là https
![](https://nimtechnology.com/wp-content/uploads/2024/04/image-27.png?v=1713554110)
Vậy giở bạn phải làm sao?
The code you’ve written in the boot()
method of your AppServiceProvider
![](https://nimtechnology.com/wp-content/uploads/2024/04/image-28.png?v=1713554149)
<?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