D
D
Denis Bukreev2018-04-27 11:02:26
Laravel
Denis Bukreev, 2018-04-27 11:02:26

How to add https to routes?

Registered in .env on production APP_URL with https
But when forming a route using route('name') laravel generates a URL with http when the whole site is on https.
In theory, after all, it should generate a normal url, maybe something is not taken into account somewhere?
Or maybe rewrite the route() function?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iljaGolubev, 2018-04-27
@denisbookreev

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        \URL::forceScheme('https');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question