2015-03-16 22:45:25 +01:00
|
|
|
<?php
|
|
|
|
|
2015-08-20 17:09:04 +02:00
|
|
|
use App\Models\User;
|
|
|
|
use App\Models\Account;
|
2015-09-25 11:57:40 +02:00
|
|
|
use App\Models\Affiliate;
|
2015-08-20 17:09:04 +02:00
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
class UserTableSeeder extends Seeder
|
|
|
|
{
|
|
|
|
|
|
|
|
public function run()
|
|
|
|
{
|
2015-08-20 17:09:04 +02:00
|
|
|
$this->command->info('Running UserTableSeeder');
|
|
|
|
|
|
|
|
Eloquent::unguard();
|
|
|
|
|
2016-04-19 04:35:18 +02:00
|
|
|
$company = Company::create();
|
|
|
|
|
2015-08-20 17:09:04 +02:00
|
|
|
$account = Account::create([
|
2015-11-06 11:59:53 +01:00
|
|
|
//'name' => 'Test Account',
|
2015-11-03 20:03:24 +01:00
|
|
|
'account_key' => str_random(RANDOM_KEY_LENGTH),
|
2015-08-20 17:09:04 +02:00
|
|
|
'timezone_id' => 1,
|
2016-04-19 04:35:18 +02:00
|
|
|
'company_id' => $company,
|
2015-08-20 17:09:04 +02:00
|
|
|
]);
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2015-08-20 17:09:04 +02:00
|
|
|
User::create([
|
|
|
|
'email' => TEST_USERNAME,
|
|
|
|
'username' => TEST_USERNAME,
|
|
|
|
'account_id' => $account->id,
|
|
|
|
'password' => Hash::make(TEST_PASSWORD),
|
2015-08-30 14:08:15 +02:00
|
|
|
'registered' => true,
|
|
|
|
'confirmed' => true,
|
2015-08-20 17:09:04 +02:00
|
|
|
]);
|
2015-09-25 11:57:40 +02:00
|
|
|
|
|
|
|
Affiliate::create([
|
|
|
|
'affiliate_key' => SELF_HOST_AFFILIATE_KEY
|
|
|
|
]);
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|