Changeset View
Changeset View
Standalone View
Standalone View
src/database/seeds/UserSeeder.php
Show All 26 Lines | public function run() | ||||
+ Domain::STATUS_CONFIRMED | + Domain::STATUS_CONFIRMED | ||||
+ Domain::STATUS_VERIFIED, | + Domain::STATUS_VERIFIED, | ||||
'type' => Domain::TYPE_EXTERNAL | 'type' => Domain::TYPE_EXTERNAL | ||||
] | ] | ||||
); | ); | ||||
$john = User::create( | $john = User::create( | ||||
[ | [ | ||||
'name' => 'John Doe', | |||||
'email' => 'john@kolab.org', | 'email' => 'john@kolab.org', | ||||
'password' => 'simple123', | 'password' => 'simple123', | ||||
'email_verified_at' => now() | |||||
] | ] | ||||
); | ); | ||||
$john->setSettings( | $john->setSettings( | ||||
[ | [ | ||||
'first_name' => 'John', | 'first_name' => 'John', | ||||
'last_name' => 'Doe', | 'last_name' => 'Doe', | ||||
'currency' => 'USD', | 'currency' => 'USD', | ||||
'country' => 'US', | 'country' => 'US', | ||||
'billing_address' => "601 13th Street NW\nSuite 900 South\nWashington, DC 20005", | 'billing_address' => "601 13th Street NW\nSuite 900 South\nWashington, DC 20005", | ||||
'external_email' => 'john.doe.external@gmail.com', | 'external_email' => 'john.doe.external@gmail.com', | ||||
'organization' => 'Kolab Developers', | |||||
'phone' => '+1 509-248-1111', | 'phone' => '+1 509-248-1111', | ||||
] | ] | ||||
); | ); | ||||
$john->setAliases(['john.doe@kolab.org']); | $john->setAliases(['john.doe@kolab.org']); | ||||
$wallet = $john->wallets->first(); | $wallet = $john->wallets->first(); | ||||
$package_domain = \App\Package::where('title', 'domain-hosting')->first(); | $package_domain = \App\Package::where('title', 'domain-hosting')->first(); | ||||
$package_kolab = \App\Package::where('title', 'kolab')->first(); | $package_kolab = \App\Package::where('title', 'kolab')->first(); | ||||
$package_lite = \App\Package::where('title', 'lite')->first(); | $package_lite = \App\Package::where('title', 'lite')->first(); | ||||
$domain->assignPackage($package_domain, $john); | $domain->assignPackage($package_domain, $john); | ||||
$john->assignPackage($package_kolab); | $john->assignPackage($package_kolab); | ||||
$jack = User::create( | $jack = User::create( | ||||
[ | [ | ||||
'name' => 'Jack Daniels', | |||||
'email' => 'jack@kolab.org', | 'email' => 'jack@kolab.org', | ||||
'password' => 'simple123', | 'password' => 'simple123', | ||||
'email_verified_at' => now() | |||||
] | ] | ||||
); | ); | ||||
$jack->setSettings( | $jack->setSettings( | ||||
[ | [ | ||||
'first_name' => 'Jack', | 'first_name' => 'Jack', | ||||
'last_name' => 'Daniels', | 'last_name' => 'Daniels', | ||||
'currency' => 'USD', | 'currency' => 'USD', | ||||
'country' => 'US' | 'country' => 'US' | ||||
] | ] | ||||
); | ); | ||||
$jack->setAliases(['jack.daniels@kolab.org']); | $jack->setAliases(['jack.daniels@kolab.org']); | ||||
$john->assignPackage($package_kolab, $jack); | $john->assignPackage($package_kolab, $jack); | ||||
foreach ($john->entitlements as $entitlement) { | foreach ($john->entitlements as $entitlement) { | ||||
$entitlement->created_at = Carbon::now()->subMonthsWithoutOverflow(1); | $entitlement->created_at = Carbon::now()->subMonthsWithoutOverflow(1); | ||||
$entitlement->updated_at = Carbon::now()->subMonthsWithoutOverflow(1); | $entitlement->updated_at = Carbon::now()->subMonthsWithoutOverflow(1); | ||||
$entitlement->save(); | $entitlement->save(); | ||||
} | } | ||||
$ned = User::create( | $ned = User::create( | ||||
[ | [ | ||||
'name' => 'Edward Flanders', | |||||
'email' => 'ned@kolab.org', | 'email' => 'ned@kolab.org', | ||||
'password' => 'simple123', | 'password' => 'simple123', | ||||
'email_verified_at' => now() | |||||
] | ] | ||||
); | ); | ||||
$ned->setSettings( | $ned->setSettings( | ||||
[ | [ | ||||
'first_name' => 'Edward', | 'first_name' => 'Edward', | ||||
'last_name' => 'Flanders', | 'last_name' => 'Flanders', | ||||
'currency' => 'USD', | 'currency' => 'USD', | ||||
Show All 10 Lines | public function run() | ||||
// Ned is also our 2FA test user | // Ned is also our 2FA test user | ||||
$sku2fa = Sku::firstOrCreate(['title' => '2fa']); | $sku2fa = Sku::firstOrCreate(['title' => '2fa']); | ||||
$ned->assignSku($sku2fa); | $ned->assignSku($sku2fa); | ||||
SecondFactor::seed('ned@kolab.org'); | SecondFactor::seed('ned@kolab.org'); | ||||
$joe = User::create( | $joe = User::create( | ||||
[ | [ | ||||
'name' => 'Joe Sixpack', | |||||
'email' => 'joe@kolab.org', | 'email' => 'joe@kolab.org', | ||||
'password' => 'simple123', | 'password' => 'simple123', | ||||
'email_verified_at' => now() | |||||
] | ] | ||||
); | ); | ||||
$john->assignPackage($package_lite, $joe); | $john->assignPackage($package_lite, $joe); | ||||
factory(User::class, 10)->create(); | factory(User::class, 10)->create(); | ||||
$jeroen = User::create( | $jeroen = User::create( | ||||
[ | [ | ||||
'name' => 'Jeroen van Meeuwen', | |||||
'email' => 'jeroen@jeroen.jeroen', | 'email' => 'jeroen@jeroen.jeroen', | ||||
'password' => 'jeroen', | 'password' => 'jeroen', | ||||
'email_verified_at' => now() | |||||
] | ] | ||||
); | ); | ||||
$jeroen->role = "admin"; | $jeroen->role = "admin"; | ||||
$jeroen->save(); | $jeroen->save(); | ||||
} | } | ||||
} | } |