Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 5dce45d

Browse files
authored
Merge pull request #19 from forepath/feat/https_link_enforcement
feat: https link enforcement
2 parents 7d80f79 + 6a174fd commit 5dce45d

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ APP_ENV=local
44
APP_KEY=
55
APP_DEBUG=true
66
APP_URL=http://localhost
7+
APP_FORCE_HTTPS=false
78

89
LOG_CHANNEL=stack
910
LOG_DEPRECATIONS_CHANNEL=null

app/Providers/AppServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Illuminate\Support\Facades\File;
1414
use Illuminate\Support\Facades\Log;
1515
use Illuminate\Support\Facades\Schema;
16+
use Illuminate\Support\Facades\URL;
1617
use Illuminate\Support\Facades\View;
1718
use Illuminate\Support\ServiceProvider;
1819

@@ -33,6 +34,10 @@ public function register()
3334
*/
3435
public function boot()
3536
{
37+
if (config('app.force_https')) {
38+
URL::forceScheme('https');
39+
}
40+
3641
try {
3742
if (Schema::hasTable('settings')) {
3843
$tenant = request()->tenant;

config/app.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,10 @@
239239
'URL' => Illuminate\Support\Facades\URL::class,
240240
'Validator' => Illuminate\Support\Facades\Validator::class,
241241
'View' => Illuminate\Support\Facades\View::class,
242-
'PDF' => Barryvdh\DomPDF\Facade::class,
242+
'PDF' => Barryvdh\DomPDF\PDF::class,
243243

244244
],
245245

246+
'force_https' => env('APP_FORCE_HTTPS', false),
247+
246248
];

0 commit comments

Comments
 (0)