https is a secure url and we know google give first priority to search that use https. So if you have using http only from scratch and if you install ssl certificate then your website will open with https.
So, As we know, If you open with http url then all the links of page will generate with http from route. But if you want to force generate https link from route then you can do it. you can generate https link from route using URL::forceSchema('https').
We have to just force generate https link using "URL::forceSchema('https')" helper in AppServiceProvider.
app/Providers/AppServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use URL;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
URL::forceSchema('https');
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
Now you can just check it.
I hope you found your best.....
Do you like below Tutorials ?
- How to Copy File from One Folder to Another in Laravel?
- How to Move File from One Folder to Another in Laravel?
- Laravel Remove File from Storage Folder Example
- React JS Textbox onchange Event Example
- React JS Textarea onchange Event Example
- React JS Select onchange Event Example
- React JS Radio onchange Event Example
- React JS Checkbox onchange Event Example