Skip to content

Commit ee76b71

Browse files
Fix URL handling in local environment by enforcing HTTPS scheme and root URL
1 parent 441f39e commit ee76b71

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/Providers/AppServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Providers;
44

5+
use Illuminate\Support\Facades\URL;
56
use Illuminate\Support\ServiceProvider;
67

78
class AppServiceProvider extends ServiceProvider
@@ -19,5 +20,9 @@ public function register(): void
1920
*/
2021
public function boot(): void
2122
{
23+
if ($this->app->environment('local')) {
24+
URL::forceRootUrl(env('APP_URL'));
25+
URL::forceScheme('https');
26+
}
2227
}
2328
}

0 commit comments

Comments
 (0)