setup wizard funcionality upgrade for v2

This commit is contained in:
Čarodej
2022-02-11 10:05:12 +01:00
parent 3867c9cd67
commit 03730b80c0
33 changed files with 517 additions and 448 deletions
@@ -25,8 +25,7 @@ class SetupDevEnvironment extends Command
/**
* The name and signature of the console command.
*/
protected $signature = 'setup:dev';
protected string $license = 'Extended';
protected $signature = 'setup:dev {license=extended}';
/**
* The console command description.
@@ -58,7 +57,7 @@ class SetupDevEnvironment extends Command
$this->info('Storing default settings and content...');
($this->seedDefaultPages)();
($this->seedDefaultSettings)($this->license);
($this->seedDefaultSettings)($this->argument('type'));
($this->seedDefaultLanguage)();
$this->store_default_settings();
@@ -958,8 +957,8 @@ class SetupDevEnvironment extends Command
// Get options
collect([
[
'name' => 'setup_wizard_database',
'value' => 1,
'name' => 'app_color',
'value' => '#00BC7E',
],
[
'name' => 'app_title',
@@ -1027,7 +1026,7 @@ class SetupDevEnvironment extends Command
],
[
'name' => 'license',
'value' => $this->license,
'value' => $this->argument('type'),
],
[
'name' => 'purchase_code',
@@ -14,9 +14,7 @@ class SetupProdEnvironment extends Command
/**
* The name and signature of the console command.
*/
protected $signature = 'setup:prod';
protected string $license = 'Extended';
protected $signature = 'setup:prod {license=extended}';
/**
* The console command description.
@@ -53,7 +51,7 @@ class SetupProdEnvironment extends Command
$this->store_default_settings();
($this->seedDefaultPages)();
($this->seedDefaultSettings)($this->license);
($this->seedDefaultSettings)($this->argument('type'));
($this->seedDefaultLanguage)();
$this->info('Creating default admin...');
@@ -73,8 +71,8 @@ class SetupProdEnvironment extends Command
// Get options
collect([
[
'name' => 'setup_wizard_database',
'value' => 1,
'name' => 'app_color',
'value' => '#00BC7E',
],
[
'name' => 'app_title',
@@ -138,7 +136,7 @@ class SetupProdEnvironment extends Command
],
[
'name' => 'license',
'value' => $this->license,
'value' => $this->argument('type'),
],
[
'name' => 'purchase_code',
+5 -5
View File
@@ -47,13 +47,13 @@ class UserResource extends JsonResource
$this->mergeWhen($this->hasSubscription(), fn () => [
'subscription' => new SubscriptionResource($this->subscription),
]),
$this->mergeWhen($isMeteredSubscription, fn () => [
$this->mergeWhen($isMeteredSubscription && $this->hasSubscription(), fn () => [
'balance' => new BalanceResource($this->balance),
]),
$this->mergeWhen($isMeteredSubscription, fn () => [
$this->mergeWhen($isMeteredSubscription && $this->hasSubscription(), fn () => [
'alert' => new BillingAlertResource($this->billingAlert),
]),
$this->mergeWhen($isMeteredSubscription, fn () => [
$this->mergeWhen($isMeteredSubscription && $this->hasSubscription(), fn () => [
'failedPayments' => new FailedPaymentsCollection($this->failedPayments),
]),
],
@@ -68,10 +68,10 @@ class UserResource extends JsonResource
$this->mergeWhen($isFixedSubscription, fn () => [
'limitations' => $this->limitations->summary(),
]),
$this->mergeWhen($isMeteredSubscription, fn () => [
$this->mergeWhen($isMeteredSubscription && $this->hasSubscription(), fn () => [
'usages' => $this->getUsageEstimates(),
]),
$this->mergeWhen($isMeteredSubscription, fn () => [
$this->mergeWhen($isMeteredSubscription && $this->hasSubscription(), fn () => [
'totalDebt' => [
'formatted' => format_currency($this->failedPayments->sum('amount'), $this->subscription->plan->currency),
'amount' => $this->failedPayments->sum('amount'),