Skip to content

Commit

Permalink
Add option to set license key during install
Browse files Browse the repository at this point in the history
  • Loading branch information
robdekort committed Feb 19, 2024
1 parent 539c458 commit 29203d2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions StarterKitPostInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ protected function overwriteEnvWithPresets(): void
}

$this->setAppName();
$this->setLicenseKey();
$this->setAppUrl();
$this->setAppKey();

Expand Down Expand Up @@ -260,6 +261,18 @@ protected function setAppName(): void
$this->replaceInReadme('APP_NAME="Statamic Peak"', "APP_NAME=\"{$appName}\"");
}

protected function setLicenseKey(): void
{
$licenseKey = text(
label: 'Enter your Statamic License key',
hint: 'Leave empty to skip',
default: $this->interactive ? '' : 'Statamic Peak',
required: false,
);

$this->replaceInEnv('STATAMIC_LICENSE_KEY=', "STATAMIC_LICENSE_KEY=\"{$licenseKey}\"");
}

protected function setAppUrl(): void
{
$appUrl = env('APP_URL');
Expand Down

0 comments on commit 29203d2

Please sign in to comment.