Changeset View
Changeset View
Standalone View
Standalone View
src/database/seeds/local/SkuSeeder.php
Show First 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | public function run() | ||||
'cost' => 0, | 'cost' => 0, | ||||
'units_free' => 0, | 'units_free' => 0, | ||||
'period' => 'monthly', | 'period' => 'monthly', | ||||
'handler_class' => 'App\Handlers\Beta\SharedFolders', | 'handler_class' => 'App\Handlers\Beta\SharedFolders', | ||||
'active' => true, | 'active' => true, | ||||
]); | ]); | ||||
} | } | ||||
// Check existence because migration might have added this already | |||||
$sku = Sku::where(['title' => 'beta-files', 'tenant_id' => \config('app.tenant_id')])->first(); | |||||
if (!$sku) { | |||||
Sku::create([ | |||||
'title' => 'beta-files', | |||||
'name' => 'File storage', | |||||
'description' => 'Access to file storage', | |||||
'cost' => 0, | |||||
'units_free' => 0, | |||||
'period' => 'monthly', | |||||
'handler_class' => 'App\Handlers\Beta\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 |