1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/database/seeds/UserTableSeeder.php
Joshua Dwire 22f65e8108 Finalize multi-plan support
* Allow admins to change plan
* Check features instead of plans
* Support linking/unlinking accounts
* Support creating/deleting accounts
2016-04-18 22:35:18 -04:00

40 lines
886 B
PHP

<?php
use App\Models\User;
use App\Models\Account;
use App\Models\Affiliate;
class UserTableSeeder extends Seeder
{
public function run()
{
$this->command->info('Running UserTableSeeder');
Eloquent::unguard();
$company = Company::create();
$account = Account::create([
//'name' => 'Test Account',
'account_key' => str_random(RANDOM_KEY_LENGTH),
'timezone_id' => 1,
'company_id' => $company,
]);
User::create([
'email' => TEST_USERNAME,
'username' => TEST_USERNAME,
'account_id' => $account->id,
'password' => Hash::make(TEST_PASSWORD),
'registered' => true,
'confirmed' => true,
]);
Affiliate::create([
'affiliate_key' => SELF_HOST_AFFILIATE_KEY
]);
}
}