当前位置: 首页>>代码示例>>PHP>>正文


PHP Account::create方法代码示例

本文整理汇总了PHP中app\models\Account::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Account::create方法的具体用法?PHP Account::create怎么用?PHP Account::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Account的用法示例。


在下文中一共展示了Account::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $this->command->info('Running UserTableSeeder');
     Eloquent::unguard();
     $account = Account::create(['name' => 'Test Account', 'account_key' => str_random(16), 'timezone_id' => 1]);
     User::create(['email' => TEST_USERNAME, 'username' => TEST_USERNAME, 'account_id' => $account->id, 'password' => Hash::make(TEST_PASSWORD)]);
 }
开发者ID:jgyaipl,项目名称:invoice-ninja,代码行数:7,代码来源:UserTableSeeder.php

示例2: run

 public function run()
 {
     $this->command->info('Running UserTableSeeder');
     Eloquent::unguard();
     $account = Account::create(['name' => 'Test Account', 'account_key' => str_random(16), 'timezone_id' => 1]);
     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]);
 }
开发者ID:nafrente,项目名称:invoice-ninja,代码行数:8,代码来源:UserTableSeeder.php

示例3: run

 public function run()
 {
     $this->command->info('Running UserTableSeeder');
     Eloquent::unguard();
     $faker = Faker\Factory::create();
     $company = Company::create();
     $account = Account::create(['name' => $faker->name, 'address1' => $faker->streetAddress, 'address2' => $faker->secondaryAddress, 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, 'country_id' => Country::all()->random()->id, 'account_key' => str_random(RANDOM_KEY_LENGTH), 'invoice_terms' => $faker->text($faker->numberBetween(50, 300)), 'work_phone' => $faker->phoneNumber, 'work_email' => $faker->safeEmail, 'invoice_design_id' => min(InvoiceDesign::all()->random()->id, 10), 'header_font_id' => min(Font::all()->random()->id, 17), 'body_font_id' => min(Font::all()->random()->id, 17), 'primary_color' => $faker->hexcolor, 'timezone_id' => 1, 'company_id' => $company->id]);
     User::create(['email' => TEST_USERNAME, 'username' => TEST_USERNAME, 'account_id' => $account->id, 'password' => Hash::make(TEST_PASSWORD), 'registered' => true, 'confirmed' => true, 'notify_sent' => false, 'notify_paid' => false]);
     Affiliate::create(['affiliate_key' => SELF_HOST_AFFILIATE_KEY]);
 }
开发者ID:medea61,项目名称:invoiceninja,代码行数:10,代码来源:UserTableSeeder.php

示例4: run

 public function run()
 {
     $this->command->info('Running UserTableSeeder');
     Eloquent::unguard();
     $faker = Faker\Factory::create();
     $company = Company::create();
     $account = Account::create(['name' => $faker->name, 'address1' => $faker->streetAddress, 'address2' => $faker->secondaryAddress, 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, 'country_id' => Country::all()->random()->id, 'account_key' => str_random(RANDOM_KEY_LENGTH), 'invoice_terms' => $faker->text($faker->numberBetween(50, 300)), 'work_phone' => $faker->phoneNumber, 'work_email' => $faker->safeEmail, 'invoice_design_id' => InvoiceDesign::where('id', '<', CUSTOM_DESIGN)->get()->random()->id, 'header_font_id' => min(Font::all()->random()->id, 17), 'body_font_id' => min(Font::all()->random()->id, 17), 'primary_color' => $faker->hexcolor, 'timezone_id' => 1, 'company_id' => $company->id]);
     $user = User::create(['first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'email' => TEST_USERNAME, 'username' => TEST_USERNAME, 'account_id' => $account->id, 'password' => Hash::make(TEST_PASSWORD), 'registered' => true, 'confirmed' => true, 'notify_sent' => false, 'notify_paid' => false, 'is_admin' => 1]);
     $client = Client::create(['user_id' => $user->id, 'account_id' => $account->id, 'public_id' => 1, 'name' => $faker->name, 'address1' => $faker->streetAddress, 'address2' => $faker->secondaryAddress, 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, 'country_id' => DEFAULT_COUNTRY, 'currency_id' => DEFAULT_CURRENCY]);
     Contact::create(['user_id' => $user->id, 'account_id' => $account->id, 'client_id' => $client->id, 'public_id' => 1, 'email' => env('TEST_EMAIL', TEST_USERNAME), 'is_primary' => true]);
     Product::create(['user_id' => $user->id, 'account_id' => $account->id, 'public_id' => 1, 'product_key' => 'ITEM', 'notes' => 'Something nice...', 'cost' => 10]);
     Affiliate::create(['affiliate_key' => SELF_HOST_AFFILIATE_KEY]);
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:13,代码来源:UserTableSeeder.php

示例5: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::table('accounts')->delete();
     $accounts = array(['email' => 'root@localhost', 'password' => Hash::make('admin'), 'roles' => ['owner']], ['email' => 'unprivileged@localhost', 'password' => Hash::make('secret')], ['email' => 'ryanchenkie@gmail.com', 'password' => Hash::make('secret')], ['email' => 'chris@scotch.io', 'password' => Hash::make('secret')], ['email' => 'holly@scotch.io', 'password' => Hash::make('secret')], ['email' => 'adnan@scotch.io', 'password' => Hash::make('secret')]);
     // Loop through each user above and create the record for them in the database
     foreach ($accounts as $a) {
         if (array_key_exists('roles', $a)) {
             $roles = $a['roles'];
             unset($a['roles']);
         }
         $user = Account::create($a);
         if (isset($roles)) {
             foreach ($roles as $r) {
                 $user->attachRole(Role::where('name', $r)->get()->first());
             }
             unset($roles);
         }
     }
     Model::reguard();
 }
开发者ID:a161527,项目名称:cs319-p2t5,代码行数:26,代码来源:AccountTableSeeder.php


注:本文中的app\models\Account::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。