Changeset View
Changeset View
Standalone View
Standalone View
src/database/seeds/UserSeeder.php
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | public function run() | ||||
); | ); | ||||
$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(); | |||||
$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', | 'name' => 'Jack Daniels', | ||||
'email' => 'jack@kolab.org', | 'email' => 'jack@kolab.org', | ||||
Show All 36 Lines | public function run() | ||||
'last_name' => 'Flanders', | 'last_name' => 'Flanders', | ||||
'currency' => 'USD', | 'currency' => 'USD', | ||||
'country' => 'US' | 'country' => 'US' | ||||
] | ] | ||||
); | ); | ||||
$john->assignPackage($package_kolab, $ned); | $john->assignPackage($package_kolab, $ned); | ||||
$ned->assignSku(\App\Sku::where('title', 'activesync')->first(), 1); | |||||
// Ned is a controller on Jack's wallet | // Ned is a controller on Jack's wallet | ||||
$john->wallets()->first()->addController($ned); | $john->wallets()->first()->addController($ned); | ||||
// 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( | |||||
[ | |||||
'name' => 'Joe Sixpack', | |||||
'email' => 'joe@kolab.org', | |||||
'password' => 'simple123', | |||||
'email_verified_at' => now() | |||||
] | |||||
); | |||||
$john->assignPackage($package_lite, $joe); | |||||
factory(User::class, 10)->create(); | factory(User::class, 10)->create(); | ||||
} | } | ||||
} | } |