Changeset View
Changeset View
Standalone View
Standalone View
src/database/seeds/local/SkuSeeder.php
Show All 13 Lines | class SkuSeeder extends Seeder | ||||
*/ | */ | ||||
public function run() | public function run() | ||||
{ | { | ||||
Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'mailbox', | 'title' => 'mailbox', | ||||
'name' => 'User Mailbox', | 'name' => 'User Mailbox', | ||||
'description' => 'Just a mailbox', | 'description' => 'Just a mailbox', | ||||
'cost' => 444, | 'cost' => 500, | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Mailbox', | 'handler_class' => 'App\Handlers\Mailbox', | ||||
'active' => true, | 'active' => true, | ||||
] | ] | ||||
); | ); | ||||
Sku::create( | Sku::create( | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public function run() | ||||
); | ); | ||||
Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'storage', | 'title' => 'storage', | ||||
'name' => 'Storage Quota', | 'name' => 'Storage Quota', | ||||
'description' => 'Some wiggle room', | 'description' => 'Some wiggle room', | ||||
'cost' => 25, | 'cost' => 25, | ||||
'units_free' => 2, | 'units_free' => 5, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Storage', | 'handler_class' => 'App\Handlers\Storage', | ||||
'active' => true, | 'active' => true, | ||||
] | ] | ||||
); | ); | ||||
Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'groupware', | 'title' => 'groupware', | ||||
'name' => 'Groupware Features', | 'name' => 'Groupware Features', | ||||
'description' => 'Groupware functions like Calendar, Tasks, Notes, etc.', | 'description' => 'Groupware functions like Calendar, Tasks, Notes, etc.', | ||||
'cost' => 555, | 'cost' => 490, | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Groupware', | 'handler_class' => 'App\Handlers\Groupware', | ||||
'active' => true, | 'active' => true, | ||||
] | ] | ||||
); | ); | ||||
Sku::create( | Sku::create( | ||||
Show All 33 Lines | public function run() | ||||
] | ] | ||||
); | ); | ||||
Sku::create( | Sku::create( | ||||
[ | [ | ||||
'title' => 'activesync', | 'title' => 'activesync', | ||||
'name' => 'Activesync', | 'name' => 'Activesync', | ||||
'description' => 'Mobile synchronization', | 'description' => 'Mobile synchronization', | ||||
'cost' => 100, | 'cost' => 0, | ||||
'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 | ||||
if (!\App\Sku::where('title', 'beta')->first()) { | $sku = \App\Sku::where(['title' => 'beta', 'tenant_id' => \config('app.tenant_id')])->first(); | ||||
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 | ||||
if (!\App\Sku::where('title', 'meet')->first()) { | $sku = \App\Sku::where(['title' => 'meet', 'tenant_id' => \config('app.tenant_id')])->first(); | ||||
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 | ||||
if (!\App\Sku::where('title', 'group')->first()) { | $sku = \App\Sku::where(['title' => 'group', 'tenant_id' => \config('app.tenant_id')])->first(); | ||||
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 | ||||
if (!\App\Sku::where('title', 'distlist')->first()) { | $sku = \App\Sku::where(['title' => 'distlist', 'tenant_id' => \config('app.tenant_id')])->first(); | ||||
\App\Sku::create([ | |||||
if (!$sku) { | |||||
\App\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, | ||||
]); | ] | ||||
); | |||||
} | |||||
// for tenants that are not the configured tenant id | |||||
$tenants = \App\Tenant::where('id', '!=', \config('app.tenant_id'))->get(); | |||||
foreach ($tenants as $tenant) { | |||||
$sku = Sku::create( | |||||
[ | |||||
'title' => 'mailbox', | |||||
'name' => 'User Mailbox', | |||||
'description' => 'Just a mailbox', | |||||
'cost' => 500, | |||||
'fee' => 333, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Mailbox', | |||||
'active' => true, | |||||
] | |||||
); | |||||
$sku->tenant_id = $tenant->id; | |||||
$sku->save(); | |||||
$sku = Sku::create( | |||||
[ | |||||
'title' => 'storage', | |||||
'name' => 'Storage Quota', | |||||
'description' => 'Some wiggle room', | |||||
'cost' => 25, | |||||
'fee' => 16, | |||||
'units_free' => 5, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Storage', | |||||
'active' => true, | |||||
] | |||||
); | |||||
$sku->tenant_id = $tenant->id; | |||||
$sku->save(); | |||||
$sku = Sku::create( | |||||
[ | |||||
'title' => 'domain-hosting', | |||||
'name' => 'External Domain', | |||||
'description' => 'Host a domain that is externally registered', | |||||
'cost' => 100, | |||||
'fee' => 66, | |||||
'units_free' => 1, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\DomainHosting', | |||||
'active' => true, | |||||
] | |||||
); | |||||
$sku->tenant_id = $tenant->id; | |||||
$sku->save(); | |||||
$sku = Sku::create( | |||||
[ | |||||
'title' => 'groupware', | |||||
'name' => 'Groupware Features', | |||||
'description' => 'Groupware functions like Calendar, Tasks, Notes, etc.', | |||||
'cost' => 490, | |||||
'fee' => 327, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Groupware', | |||||
'active' => true, | |||||
] | |||||
); | |||||
$sku->tenant_id = $tenant->id; | |||||
$sku->save(); | |||||
$sku = Sku::create( | |||||
[ | |||||
'title' => '2fa', | |||||
'name' => '2-Factor Authentication', | |||||
'description' => 'Two factor authentication for webmail and administration panel', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Auth2F', | |||||
'active' => true, | |||||
] | |||||
); | |||||
$sku->tenant_id = $tenant->id; | |||||
$sku->save(); | |||||
$sku = Sku::create( | |||||
[ | |||||
'title' => 'activesync', | |||||
'name' => 'Activesync', | |||||
'description' => 'Mobile synchronization', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Activesync', | |||||
'active' => true, | |||||
] | |||||
); | |||||
$sku->tenant_id = $tenant->id; | |||||
$sku->save(); | |||||
} | } | ||||
} | } | ||||
} | } |