Changeset View
Changeset View
Standalone View
Standalone View
config.prod/src/database/seeds/SkuSeeder.php
- This file was moved from src/database/seeds/production/SkuSeeder.php.
<?php | <?php | ||||
namespace Database\Seeds\Production; | namespace Database\Seeds; | ||||
use App\Sku; | use App\Sku; | ||||
use Illuminate\Database\Seeder; | use Illuminate\Database\Seeder; | ||||
class SkuSeeder extends Seeder | class SkuSeeder extends Seeder | ||||
{ | { | ||||
/** | /** | ||||
* Run the database seeds. | * Run the database seeds. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function run() | public function run() | ||||
{ | { | ||||
$skus = [ | $skus = [ | ||||
[ | [ | ||||
'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, | ||||
], | ], | ||||
[ | [ | ||||
'title' => 'domain', | 'title' => 'domain', | ||||
'name' => 'Hosted Domain', | 'name' => 'Hosted Domain', | ||||
Show All 30 Lines | public function run() | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\DomainRelay', | 'handler_class' => 'App\Handlers\DomainRelay', | ||||
'active' => false, | 'active' => false, | ||||
], | ], | ||||
[ | [ | ||||
'title' => 'storage', | 'title' => 'storage', | ||||
'name' => 'Storage Quota', | 'name' => 'Storage Quota', | ||||
'description' => 'Some wiggle room', | 'description' => 'Some wiggle room', | ||||
'cost' => 50, | '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, | ||||
], | ], | ||||
[ | [ | ||||
'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, | ||||
], | ], | ||||
[ | [ | ||||
'title' => 'resource', | 'title' => 'resource', | ||||
'name' => 'Resource', | 'name' => 'Resource', | ||||
'description' => 'Reservation taker', | 'description' => 'Reservation taker', | ||||
'cost' => 0, | 'cost' => 101, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Resource', | 'handler_class' => 'App\Handlers\Resource', | ||||
'active' => true, | 'active' => true, | ||||
], | ], | ||||
[ | [ | ||||
'title' => 'shared-folder', | 'title' => 'shared-folder', | ||||
'name' => 'Shared Folder', | 'name' => 'Shared Folder', | ||||
'description' => 'A shared folder', | 'description' => 'A shared folder', | ||||
'cost' => 89, | 'cost' => 89, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\SharedFolder', | 'handler_class' => 'App\Handlers\SharedFolder', | ||||
'active' => false, | 'active' => true, | ||||
], | ], | ||||
[ | [ | ||||
'title' => '2fa', | 'title' => '2fa', | ||||
'name' => '2-Factor Authentication', | 'name' => '2-Factor Authentication', | ||||
'description' => 'Two factor authentication for webmail and administration panel', | 'description' => 'Two factor authentication for webmail and administration panel', | ||||
'cost' => 0, | 'cost' => 0, | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Auth2F', | 'handler_class' => 'App\Handlers\Auth2F', | ||||
'active' => true, | 'active' => true, | ||||
], | ], | ||||
[ | [ | ||||
'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, | ||||
], | ], | ||||
[ | [ | ||||
'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, | ||||
], | ], | ||||
[ | [ | ||||
'title' => 'group', | 'title' => 'group', | ||||
Show All 11 Lines | public function run() | ||||
'description' => 'Shareable audio & video conference room', | 'description' => 'Shareable audio & video conference room', | ||||
'cost' => 0, | 'cost' => 0, | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\GroupRoom', | 'handler_class' => 'App\Handlers\GroupRoom', | ||||
'active' => true, | 'active' => true, | ||||
], | ], | ||||
[ | [ | ||||
'title' => 'room', | 'title' => 'room', | ||||
'name' => 'Standard conference room', | 'name' => 'Standard conference room', | ||||
'description' => 'Audio & video conference room', | 'description' => 'Audio & video conference room', | ||||
'cost' => 0, | 'cost' => 0, | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Room', | 'handler_class' => 'App\Handlers\Room', | ||||
'active' => true, | 'active' => true, | ||||
], | ], | ||||
]; | ]; | ||||
foreach ($skus as $sku) { | foreach ($skus as $sku) { | ||||
// Check existence because migration might have added this already | // Check existence because migration might have added this already | ||||
if (!Sku::where('title', $sku['title'])->first()) { | if (!Sku::where('title', $sku['title'])->where('tenant_id', \config('app.tenant_id'))->first()) { | ||||
Sku::create($sku); | Sku::create($sku); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |