1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00

force scheme

This commit is contained in:
Samuel Štancl 2021-04-07 23:28:03 +02:00
parent 6ad1c6abdb
commit ea58fea444

View file

@ -17,6 +17,9 @@ class GenerateHtml extends Command
protected $description = 'Generate the static HTML.';
public Router $router;
public UrlGenerator $url;
public function __construct(Router $router, UrlGenerator $url) {
parent::__construct();
@ -30,6 +33,10 @@ class GenerateHtml extends Command
$this->url->forceRootUrl($this->argument('rootUrl'));
if (Str::startsWith($this->argument('rootUrl'), 'https')) {
$this->url->forceScheme('https');
}
File::copyDirectory(public_path(), $outdir);
collect($this->router->getRoutes()->get())