invoiceninja/database/seeds/UserTableSeeder.php

37 lines
784 B
PHP
Raw Normal View History

2015-03-17 07:45:25 +10:00
<?php
2015-08-20 18:09:04 +03:00
use App\Models\User;
use App\Models\Account;
2015-09-25 12:57:40 +03:00
use App\Models\Affiliate;
2015-08-20 18:09:04 +03:00
2015-03-17 07:45:25 +10:00
class UserTableSeeder extends Seeder
{
public function run()
{
2015-08-20 18:09:04 +03:00
$this->command->info('Running UserTableSeeder');
Eloquent::unguard();
$account = Account::create([
'name' => 'Test Account',
'account_key' => str_random(16),
'timezone_id' => 1,
]);
2015-03-17 07:45:25 +10:00
2015-08-20 18:09:04 +03:00
User::create([
'email' => TEST_USERNAME,
'username' => TEST_USERNAME,
'account_id' => $account->id,
'password' => Hash::make(TEST_PASSWORD),
2015-08-30 15:08:15 +03:00
'registered' => true,
'confirmed' => true,
2015-08-20 18:09:04 +03:00
]);
2015-09-25 12:57:40 +03:00
Affiliate::create([
'affiliate_key' => SELF_HOST_AFFILIATE_KEY
]);
2015-03-17 07:45:25 +10:00
}
}