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 example, laravel teaching, livewire example, laravel

How to set cultural error messages in Laravel Livewire components

This article uses a simple Laravel livewire example to see how the livewire component verifies user input errors and displays Chinese error messages.

laravel,blade

New features in Laravel 5.5, in Blade's "json" directive

Laravel 5.5 supports a new directive called json. In the Blade template, json can be printed without calling json_encode.

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...