Laravel5.5 paging generates url non-https problems

Project environment: laravel5.5
uses the https protocol and has set URL::forceScheme ("https") in the AppServiceProvider boot method; if you force the use of the https protocol, the url generated by other parts is normal, but the url generated using paginate () paging is http, so solve!

Mar.25,2021

There is a withPath () method for

laravel 5.5.You can try withPath ('/') to see

.

https://laravel-china.org/doc.

another possibility is that the proxy is used in the middle. The proxy is the

of http.

withPath can be used

my controller paging list method

$data = [
        'title' => '',
        'category_list' => ServicesService::getCategoryList($this->defaultCompanyID),//
        'list' => ServicesService::getServiceItemListInfo($this->defaultCompanyID, $whereRawString, $this->loginAdminId, $this->pageSize),
    ];
    //$data['list']MODEpaginate

    //https
    $data['list']=$data['list']->withPath('/'.$request->route()->uri);
    return view('services.list', $data);
Menu