Files
autocrm/app/Providers/AppServiceProvider.php
Vasyka 1a33bc9692 fix: drop URL::forceRootUrl (Livewire/CSRF break on tenant subdomains)
forceRootUrl forces ALL generated URLs to APP_URL (service.mir.md).
On psauto.service.mir.md, Livewire-generated POST URLs targeted
service.mir.md instead of psauto, so CSRF/session cookies didn't
match → silent auth failure.

Keep forceScheme('https') so Cloudflare → Traefik → Octane proxy
chain doesn't generate http:// links, but let Laravel use the
actual request host for everything else.

Also: TextInput->lowercase() removed (not in Filament v5);
slug uses dehydrateStateUsing(strtolower) + visual CSS lowercase.
2026-05-06 18:13:47 +00:00

26 lines
761 B
PHP

<?php
namespace App\Providers;
use App\Tenancy\TenantManager;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
$this->app->singleton(TenantManager::class);
}
public function boot(): void
{
// Behind a TLS-terminating proxy (Cloudflare → Coolify Traefik → Octane).
// Force https on URL generation, but DON'T force root URL — each tenant
// subdomain must keep its own host so Livewire/CSRF work per-tenant.
if (! $this->app->runningInConsole() && (str_starts_with(config('app.url'), 'https://') || env('FORCE_HTTPS'))) {
URL::forceScheme('https');
}
}
}