diff --git a/app/Services/Forge/ForgeSetting.php b/app/Services/Forge/ForgeSetting.php index afa3c6d..c897223 100644 --- a/app/Services/Forge/ForgeSetting.php +++ b/app/Services/Forge/ForgeSetting.php @@ -69,6 +69,11 @@ class ForgeSetting */ public ?string $phpVersion = null; + /** + * The directory to deploy the site to. + */ + public ?string $directory = null; + /** * Pattern for subdomains. */ @@ -245,6 +250,7 @@ protected function validate(array $configurations): \Illuminate\Validation\Valid 'branch' => ['required', new BranchNameRegex], 'project_type' => ['string'], 'php_version' => ['nullable', 'string'], + 'directory' => ['nullable', 'string'], 'subdomain_pattern' => ['nullable', 'string'], 'command' => ['nullable', 'string'], 'nginx_template' => ['nullable', 'int'], diff --git a/app/Services/Forge/Pipeline/OrCreateNewSite.php b/app/Services/Forge/Pipeline/OrCreateNewSite.php index b90729c..a630242 100644 --- a/app/Services/Forge/Pipeline/OrCreateNewSite.php +++ b/app/Services/Forge/Pipeline/OrCreateNewSite.php @@ -41,7 +41,7 @@ private function gatherSiteData(ForgeService $service): array 'domain' => $service->getFormattedDomainName(), 'project_type' => $service->setting->projectType, 'php_version' => $service->setting->phpVersion, - 'directory' => '/public', + 'directory' => $service->setting->directory ?? '/public', ]; if ($nginxTemplate = $service->setting->nginxTemplate) { diff --git a/config/forge.php b/config/forge.php index e1b6dc4..05f80f2 100644 --- a/config/forge.php +++ b/config/forge.php @@ -46,6 +46,9 @@ // Type of the project (default: 'php'). 'project_type' => env('FORGE_PROJECT_TYPE', 'php'), + // The directory to deploy the site to (default: '/public'). + 'directory' => env('FORGE_DIRECTORY', '/public'), + // Flag indicating if site isolation is needed (default: false). 'site_isolation_required' => env('FORGE_SITE_ISOLATION', false),