by Devin Yang
(This article was automatically translated.)

Published - 2 years ago ( Updated - 2 years 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


dlaravel

How to directly execute the php artisan of different projects in the container on the host.

This article is the application teaching of D-Laravel, how to directly execute php artisan in the container on the host side. After customizing the alias, you can directly execute php artisan in the contianer in the project folder on the host side. alias a="../../artisan.sh"

web-hosting,laravel

Zhibang installs Laravel 5.4 experience sharing

Install Laravel 5.4 on Zhibang's Linux 7.0 platform, and successfully execute the case sharing, Because it was originally an old version of PHP, it can be transferred to the new version for free for the first time, So please ask them to open a test php 7.0 environment for us to test, after small adjustments, Laravel's environment can indeed be executed on Accton's managed host. This article introduces how I successfully implemented Laravel's website process in Zhibang.

docker,container,laravel

Manually update the full record of D-Laravel's user id on Nas

This article fully records how I update the uid of the fpm image on my Nas. In this article, you should learn to query related concepts such as container id and commit container.