Update AppServiceProvider to force HTTPS and configure APP_URL in app.php

This commit is contained in:
Frank John Begornia
2025-12-31 02:10:31 +08:00
parent 0f24a817ce
commit 2dbcf3e2e6
3 changed files with 7 additions and 2 deletions

View File

@@ -14,6 +14,11 @@ class AppServiceProvider extends ServiceProvider {
*/
public function boot()
{
// Force HTTPS URLs when behind a proxy (Traefik)
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
\URL::forceSchema('https');
}
//
\Blade::extend(function($value) {
return preg_replace('/\@define(.+)/', '<?php ${1}; ?>', $value);