Changeset View
Changeset View
Standalone View
Standalone View
src/database/seeds/local/SkuSeeder.php
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | public function run() | ||||
Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'resource', | 'title' => 'resource', | ||||
'name' => 'Resource', | 'name' => 'Resource', | ||||
'description' => 'Reservation taker', | 'description' => 'Reservation taker', | ||||
'cost' => 101, | 'cost' => 101, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Resource', | 'handler_class' => 'App\Handlers\Resource', | ||||
'active' => false, | 'active' => true, | ||||
] | ] | ||||
); | ); | ||||
Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'shared_folder', | 'title' => 'shared_folder', | ||||
'name' => 'Shared Folder', | 'name' => 'Shared Folder', | ||||
'description' => 'A shared folder', | 'description' => 'A shared folder', | ||||
Show All 26 Lines | public function run() | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Activesync', | 'handler_class' => 'App\Handlers\Activesync', | ||||
'active' => true, | 'active' => true, | ||||
] | ] | ||||
); | ); | ||||
// Check existence because migration might have added this already | // Check existence because migration might have added this already | ||||
$sku = \App\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 subscriptions', | ||||
'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, | ||||
] | ] | ||||
); | ); | ||||
} | } | ||||
// Check existence because migration might have added this already | // Check existence because migration might have added this already | ||||
$sku = \App\Sku::where(['title' => 'meet', 'tenant_id' => \config('app.tenant_id')])->first(); | $sku = Sku::where(['title' => 'meet', 'tenant_id' => \config('app.tenant_id')])->first(); | ||||
if (!$sku) { | if (!$sku) { | ||||
Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'meet', | 'title' => 'meet', | ||||
'name' => 'Voice & Video Conferencing (public beta)', | 'name' => 'Voice & Video Conferencing (public beta)', | ||||
'description' => 'Video conferencing tool', | 'description' => 'Video conferencing tool', | ||||
'cost' => 0, | 'cost' => 0, | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Meet', | 'handler_class' => 'App\Handlers\Meet', | ||||
'active' => true, | 'active' => true, | ||||
] | ] | ||||
); | ); | ||||
} | } | ||||
// Check existence because migration might have added this already | // Check existence because migration might have added this already | ||||
$sku = \App\Sku::where(['title' => 'group', 'tenant_id' => \config('app.tenant_id')])->first(); | $sku = Sku::where(['title' => 'group', 'tenant_id' => \config('app.tenant_id')])->first(); | ||||
if (!$sku) { | if (!$sku) { | ||||
Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'group', | 'title' => 'group', | ||||
'name' => 'Group', | 'name' => 'Group', | ||||
'description' => 'Distribution list', | 'description' => 'Distribution list', | ||||
'cost' => 0, | 'cost' => 0, | ||||
'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 | // Check existence because migration might have added this already | ||||
$sku = \App\Sku::where(['title' => 'distlist', 'tenant_id' => \config('app.tenant_id')])->first(); | $sku = Sku::where(['title' => 'distlist', 'tenant_id' => \config('app.tenant_id')])->first(); | ||||
if (!$sku) { | if (!$sku) { | ||||
\App\Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'distlist', | 'title' => 'distlist', | ||||
'name' => 'Distribution lists', | 'name' => 'Distribution lists', | ||||
'description' => 'Access to mail distribution lists', | 'description' => 'Access to mail distribution lists', | ||||
'cost' => 0, | 'cost' => 0, | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Distlist', | 'handler_class' => 'App\Handlers\Distlist', | ||||
'active' => true, | '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, | |||||
]); | |||||
} | |||||
// 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 |