feat: single-domain deployment mode for self-hosted/Docker#121
Merged
ManukMinasyan merged 15 commits intomainfrom Feb 15, 2026
Merged
feat: single-domain deployment mode for self-hosted/Docker#121ManukMinasyan merged 15 commits intomainfrom
ManukMinasyan merged 15 commits intomainfrom
Conversation
Update AppPanelProvider to use config keys app.app_panel_domain and app.app_panel_path instead of hardcoded subdomain, following the same pattern as SystemAdminPanelProvider.
There was a problem hiding this comment.
Pull request overview
This pull request adds configurable domain/path routing for the application panel, enabling self-hosted and Docker deployments without subdomain requirements. The changes follow the existing pattern used by the SystemAdmin panel (if domain config exists, use ->domain(), else use ->path()).
Changes:
- Adds path-based routing as the default mode (panel served at
/app) - Adds optional domain-based routing via
APP_PANEL_DOMAINenvironment variable - Updates URL generation macros to be routing-mode-aware
- Fixes route redirect behavior to work correctly in both modes
- Adds comprehensive test coverage for both routing modes
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/Feature/Routing/AppPanelRoutingTest.php |
New comprehensive test suite covering path mode, domain mode, panel configuration, URL generation, and authentication redirects |
tests/Feature/Public/PublicPagesTest.php |
Updates test descriptions from "subdomain" to "app panel" for clarity |
routes/web.php |
Fixes redirects to use redirect()->to() instead of redirect()->away() and makes /dashboard redirect evaluate at request time |
docker-compose.prod.yml |
Documents new APP_PANEL_DOMAIN environment variable |
config/login-link.php |
Updates allowed hosts to include configurable app panel domain |
config/app.php |
Adds app_panel_domain and app_panel_path configuration keys with documentation |
app/Providers/MacroServiceProvider.php |
Updates getAppUrl() macro to support both domain and path routing modes |
app/Providers/Filament/AppPanelProvider.php |
Implements conditional domain/path configuration following existing SystemAdmin pattern |
.env.example |
Documents new APP_PANEL_DOMAIN and APP_PANEL_PATH configuration options |
Comments suppressed due to low confidence (1)
app/Providers/MacroServiceProvider.php:32
- The getPublicUrl macro doesn't preserve the port from APP_URL. If APP_URL is
http://localhost:8080, the generated URL will behttp://localhost/instead ofhttp://localhost:8080/.
The parsed URL components should include the port when building the final URL. Consider using the full parsed URL or explicitly handling the port component.
URL::macro('getPublicUrl', function (string $path = ''): string {
$baseUrl = config('app.url');
$parsed = parse_url((string) $baseUrl);
$scheme = $parsed['scheme'] ?? 'https';
$host = $parsed['host'] ?? 'localhost';
return $scheme.'://'.$host.'/'.ltrim($path, '/');
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #69
/app— zero config needed for Docker/self-hostedAPP_PANEL_DOMAIN=app.example.comfor subdomain routing (SaaS)SystemAdminPanelProviderpattern (if domain → domain, else → path)Changes
config/app.php— newapp_panel_domain/app_panel_pathconfig keysAppPanelProvider.php— conditional domain/path usingif/else(not both)MacroServiceProvider.php—getAppUrl()macro is now routing-mode-aware with port supportroutes/web.php—redirect()->away()→redirect()->to(), fix boot-time/dashboardevaluationconfig/login-link.php— conditional allowed hosts.env.example/docker-compose.prod.yml— document new env varsSaaS migration
One line in production
.env:Test plan
getDomains()/getPath()match expected state/login,/register,/forgot-password,/dashboardAPP_PANEL_DOMAIN=app.relaticle.testserves panel at subdomain root/app