first commit
This commit is contained in:
commit
405df0a122
3083 changed files with 69203 additions and 0 deletions
51
app/Providers/AppServiceProvider.php
Normal file
51
app/Providers/AppServiceProvider.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
// Force HTTPS when running behind a proxy (like Traefik)
|
||||
if ($this->app->environment('local', 'production')) {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
|
||||
// Trust proxies for correct request detection
|
||||
$this->app['request']->server->set('HTTPS', 'on');
|
||||
|
||||
// Set dynamic asset URL based on current domain/theme
|
||||
// This is needed for Vite to use the correct asset subdomain
|
||||
//config(['app.asset_url' => 'https://assets.businessportal24.test']);
|
||||
|
||||
//$this->setDynamicAssetUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the asset URL dynamically based on the current theme
|
||||
*/
|
||||
protected function setDynamicAssetUrl(): void
|
||||
{
|
||||
try {
|
||||
$assetUrl = \App\Helpers\ThemeHelper::getAssetUrl();
|
||||
config(['app.asset_url' => $assetUrl]);
|
||||
} catch (\Exception $e) {
|
||||
// Fallback to default if theme detection fails
|
||||
config(['app.asset_url' => 'https://assets.pr-copilot.test']);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue