by Devin Yang
(This article was automatically translated.)

Published - 1 year ago ( Updated - 1 year ago )

The problem I encountered is probably this. The container environment runs Laravel.
There is no HTTPS in the container, which causes Laravel to transmit the form without https.
Add the following syntax to the boot of AppServiceProvider

< code class="language-php">\URL::forceScheme('https');

Probably like this

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        
                \URL::forceScheme('https');
        
    }

}

Tags: laravel

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


laravel

Customize your own helper in laravel

In the Laravel framework, a considerable number of PHP functions (php functions), called helpers, are included. https://laravel.com/docs/5.6/helpers So how do we customize our own helper in Laravel? It's actually quite simple.. Just add files in autoload in composer.json.

dlaravel

D-Laravel released v1.1.5

In response to the launch of Laravel 5.5, PHP also released PHP 7.0.23 and PHP 7.1.9. The fpm version used by D-Laravel is also updated...just adjust the version defined by your docker-compose You can use the latest php...

laravel

Laravel thought organization, from Model to DatabaseSeeder.

This article will introduce the relevant instruction use cases step by step: Model=>Factory=>Seeder=>DatabaseSeeder Step by step, let us examine all the processes from the Model to the DatabaseSeeder.