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


laravel

Laravel 5.7 new feature dump-server.

In Laravel 5.7.x, the artisan command starts to support and integrate Symfony's dump-server. Through the artisan command, start the dump-server, and we can display the dump data on the console.

laravel,woops

Laravel 5.5 Woops is back, let's check it out.

Woops is a framework for PHP error handling. It was preloaded in Laravel 4, but it was removed in Laravel 5.0, and now 5.5 is back.... Some features of Whoops include: - Flexible, stack-based error handling - No dependencies are required to use the current stand-alone library - Simple API for handling exceptions, tracking frames and their data -Include a stunning error page within your web application - Includes the ability to open referenced files directly in editors and IDEs - Includes handlers for different response formats (JSON, XML, SOAP) -Easy to extend and integrate with existing libraries - Clean, well structured and proven generation

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.