Changeset View
Changeset View
Standalone View
Standalone View
src/database/seeds/local/SkuSeeder.php
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | public function run() | ||||
// Check existence because migration might have added this already | // Check existence because migration might have added this already | ||||
$sku = Sku::where(['title' => 'beta', 'tenant_id' => \config('app.tenant_id')])->first(); | $sku = Sku::where(['title' => 'beta', 'tenant_id' => \config('app.tenant_id')])->first(); | ||||
if (!$sku) { | if (!$sku) { | ||||
Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'beta', | 'title' => 'beta', | ||||
'name' => 'Private Beta (invitation only)', | 'name' => 'Private Beta (invitation only)', | ||||
'description' => 'Access to the private beta program subscriptions', | 'description' => 'Access to the private beta program features', | ||||
'cost' => 0, | 'cost' => 0, | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Beta', | 'handler_class' => 'App\Handlers\Beta', | ||||
'active' => false, | 'active' => false, | ||||
] | ] | ||||
); | ); | ||||
} | } | ||||
Show All 29 Lines | public function run() | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Group', | 'handler_class' => 'App\Handlers\Group', | ||||
'active' => true, | 'active' => true, | ||||
] | ] | ||||
); | ); | ||||
} | } | ||||
// Check existence because migration might have added this already | |||||
$sku = Sku::where(['title' => 'beta-distlists', 'tenant_id' => \config('app.tenant_id')])->first(); | |||||
if (!$sku) { | |||||
Sku::create( | |||||
[ | |||||
'title' => 'beta-distlists', | |||||
'name' => 'Distribution lists', | |||||
'description' => 'Access to mail distribution lists', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Beta\Distlists', | |||||
'active' => true, | |||||
] | |||||
); | |||||
} | |||||
// Check existence because migration might have added this already | |||||
$sku = Sku::where(['title' => 'beta-resources', 'tenant_id' => \config('app.tenant_id')])->first(); | |||||
if (!$sku) { | |||||
Sku::create([ | |||||
'title' => 'beta-resources', | |||||
'name' => 'Calendaring resources', | |||||
'description' => 'Access to calendaring resources', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Beta\Resources', | |||||
'active' => true, | |||||
]); | |||||
} | |||||
// Check existence because migration might have added this already | |||||
$sku = Sku::where(['title' => 'beta-shared-folders', 'tenant_id' => \config('app.tenant_id')])->first(); | |||||
if (!$sku) { | |||||
Sku::create([ | |||||
'title' => 'beta-shared-folders', | |||||
'name' => 'Shared folders', | |||||
'description' => 'Access to shared folders', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Beta\SharedFolders', | |||||
'active' => true, | |||||
]); | |||||
} | |||||
// Check existence because migration might have added this already | |||||
$sku = Sku::where(['title' => 'files', 'tenant_id' => \config('app.tenant_id')])->first(); | |||||
if (!$sku) { | |||||
Sku::create([ | |||||
'title' => 'files', | |||||
'name' => 'File storage', | |||||
'description' => 'Access to file storage', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Files', | |||||
'active' => true, | |||||
]); | |||||
} | |||||
// for tenants that are not the configured tenant id | // for tenants that are not the configured tenant id | ||||
$tenants = \App\Tenant::where('id', '!=', \config('app.tenant_id'))->get(); | $tenants = \App\Tenant::where('id', '!=', \config('app.tenant_id'))->get(); | ||||
foreach ($tenants as $tenant) { | foreach ($tenants as $tenant) { | ||||
$sku = Sku::create( | $sku = Sku::create( | ||||
[ | [ | ||||
'title' => 'mailbox', | 'title' => 'mailbox', | ||||
'name' => 'User Mailbox', | 'name' => 'User Mailbox', | ||||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |