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


PHP Eloquent::reguard方法代码示例

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


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

示例1: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     $this->call(BillTableSeeder::class);
     $this->call(CategoryTableSeeder::class);
     Eloquent::reguard();
 }
开发者ID:riverrun46,项目名称:fool-and-full,代码行数:12,代码来源:DatabaseSeeder.php

示例2: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     $this->call('NestedEntitiesTableSeeder');
     $this->command->info('NestedEntitiesTable seeded.');
     Eloquent::reguard();
 }
开发者ID:AudithSoftworks,项目名称:Basis-API,代码行数:12,代码来源:DatabaseSeeder.php

示例3: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     $this->call(UserTableSeeder::class);
     $tbis->call(EventsTableSeeder::class);
     Eloquent::reguard();
 }
开发者ID:jayrav13,项目名称:hackbu-2016,代码行数:12,代码来源:DatabaseSeeder.php

示例4: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     $this->createAffiliateTypes();
     $this->createStateType();
     $this->createaffiliateState();
     Eloquent::reguard();
 }
开发者ID:MUS3RP0L,项目名称:Plataforma-Virtual,代码行数:13,代码来源:AffiliateTypeandStateTableSeeder.php

示例5: getModel

 /**
  * Return the versioned model
  * @return mixed
  */
 public function getModel()
 {
     $model = new $this->versionable_type();
     \Eloquent::unguard();
     $model->fill(unserialize($this->model_data));
     $model->exists = true;
     \Eloquent::reguard();
     return $model;
 }
开发者ID:badsoft,项目名称:versionable,代码行数:13,代码来源:Version.php

示例6: prepareForTests

 /**
  * Migrates the database.
  *
  */
 private function prepareForTests()
 {
     Artisan::call('migrate:reset');
     Artisan::call('migrate');
     Eloquent::unguard();
     // create roles
     $this->generateRoles();
     Eloquent::reguard();
     // reset redis db
     App::make('redis')->flushAll();
 }
开发者ID:kcsamita,项目名称:laravelsnippets,代码行数:15,代码来源:TestCase.php

示例7: run

 public function run()
 {
     Eloquent::unguard();
     $industries = [['name' => 'Accounting & Legal'], ['name' => 'Advertising'], ['name' => 'Aerospace'], ['name' => 'Agriculture'], ['name' => 'Automotive'], ['name' => 'Banking & Finance'], ['name' => 'Biotechnology'], ['name' => 'Broadcasting'], ['name' => 'Business Services'], ['name' => 'Commodities & Chemicals'], ['name' => 'Communications'], ['name' => 'Computers & Hightech'], ['name' => 'Defense'], ['name' => 'Energy'], ['name' => 'Entertainment'], ['name' => 'Government'], ['name' => 'Healthcare & Life Sciences'], ['name' => 'Insurance'], ['name' => 'Manufacturing'], ['name' => 'Marketing'], ['name' => 'Media'], ['name' => 'Nonprofit & Higher Ed'], ['name' => 'Pharmaceuticals'], ['name' => 'Professional Services & Consulting'], ['name' => 'Real Estate'], ['name' => 'Retail & Wholesale'], ['name' => 'Sports'], ['name' => 'Transportation'], ['name' => 'Travel & Luxury'], ['name' => 'Other'], ['name' => 'Photography'], ['name' => 'Construction']];
     foreach ($industries as $industry) {
         $record = Industry::whereName($industry['name'])->first();
         if (!$record) {
             Industry::create($industry);
         }
     }
     Eloquent::reguard();
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:12,代码来源:IndustrySeeder.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     //$this->call(UserTableSeeder::class);
     Model::reguard();
     Eloquent::unguard();
     $this->call(UserTableSeeder::class);
     $this->call(ChallengeTableSeeder::class);
     $this->call(QuestionTableSeeder::class);
     $this->call(OptionTableSeeder::class);
     $this->call(ResultTableSeeder::class);
     //$this->call(MiddleTableSeeder::class);
     Eloquent::reguard();
 }
开发者ID:Cap-y,项目名称:ImperierumChallenge,代码行数:19,代码来源:DatabaseSeeder.php

示例9: run

 public function run()
 {
     Eloquent::unguard();
     $languages = [['name' => 'English', 'locale' => 'en'], ['name' => 'Italian', 'locale' => 'it'], ['name' => 'German', 'locale' => 'de'], ['name' => 'French', 'locale' => 'fr'], ['name' => 'Brazilian Portuguese', 'locale' => 'pt_BR'], ['name' => 'Dutch', 'locale' => 'nl'], ['name' => 'Spanish', 'locale' => 'es'], ['name' => 'Norwegian', 'locale' => 'nb_NO'], ['name' => 'Danish', 'locale' => 'da'], ['name' => 'Japanese', 'locale' => 'ja'], ['name' => 'Swedish', 'locale' => 'sv'], ['name' => 'Spanish - Spain', 'locale' => 'es_ES'], ['name' => 'French - Canada', 'locale' => 'fr_CA'], ['name' => 'Lithuanian', 'locale' => 'lt'], ['name' => 'Polish', 'locale' => 'pl'], ['name' => 'Czech', 'locale' => 'cs']];
     foreach ($languages as $language) {
         $record = Language::whereLocale($language['locale'])->first();
         if ($record) {
             $record->name = $language['name'];
             $record->save();
         } else {
             Language::create($language);
         }
     }
     Eloquent::reguard();
 }
开发者ID:hannenijhuis,项目名称:invoiceninja,代码行数:15,代码来源:LanguageSeeder.php

示例10: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     // Delete all records
     Submission::whereNotNull('id')->delete();
     Form::whereNotNull('id')->delete();
     $form1 = Form::create(['slug' => 'the-test', 'title' => 'Nice test Form']);
     $form1->fields()->save(new Field(['slug' => 'name', 'title' => 'Name', 'rules' => 'required|string']));
     $form1->fields()->save(new Field(['slug' => 'rating', 'title' => 'Rating', 'rules' => 'required|integer|min:1|max:5']));
     $form2 = Form::create(['slug' => 'test-with-email-confirmation', 'title' => 'Test that sends email confirmation', 'confirmation_message' => 'Thanks for the message !', 'confirmation_email_field' => 'email', 'owner_email' => 'info@company.com', 'owner_name' => 'That Company']);
     $form2->fields()->save(new Field(['slug' => 'email', 'title' => 'Email', 'rules' => 'required|email']));
     Form::create(['slug' => 'test-with-email-notification', 'title' => 'Test with email notification', 'send_email_to' => 'john@example.com,max@example.com', 'owner_email' => 'info@company.com', 'owner_name' => 'That Company']);
     Form::create(['slug' => 'test-with-redirect', 'title' => 'Test with a redirect', 'redirect_to_url' => 'https://example.com/']);
     Form::create(['slug' => 'test-closed', 'title' => 'Closed form test', 'accept_submissions' => false]);
     Eloquent::reguard();
 }
开发者ID:clarkwinkelmann,项目名称:forms,代码行数:21,代码来源:TestFormSeeder.php

示例11: run

 public function run()
 {
     Eloquent::unguard();
     // https://github.com/caouecs/Laravel-lang
     // https://www.loc.gov/standards/iso639-2/php/code_list.php
     $languages = [['name' => 'English', 'locale' => 'en'], ['name' => 'Italian', 'locale' => 'it'], ['name' => 'German', 'locale' => 'de'], ['name' => 'French', 'locale' => 'fr'], ['name' => 'Brazilian Portuguese', 'locale' => 'pt_BR'], ['name' => 'Dutch', 'locale' => 'nl'], ['name' => 'Spanish', 'locale' => 'es'], ['name' => 'Norwegian', 'locale' => 'nb_NO'], ['name' => 'Danish', 'locale' => 'da'], ['name' => 'Japanese', 'locale' => 'ja'], ['name' => 'Swedish', 'locale' => 'sv'], ['name' => 'Spanish - Spain', 'locale' => 'es_ES'], ['name' => 'French - Canada', 'locale' => 'fr_CA'], ['name' => 'Lithuanian', 'locale' => 'lt'], ['name' => 'Polish', 'locale' => 'pl'], ['name' => 'Czech', 'locale' => 'cs'], ['name' => 'Croatian', 'locale' => 'hr'], ['name' => 'Albanian', 'locale' => 'sq']];
     foreach ($languages as $language) {
         $record = Language::whereLocale($language['locale'])->first();
         if ($record) {
             $record->name = $language['name'];
             $record->save();
         } else {
             Language::create($language);
         }
     }
     Eloquent::reguard();
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:17,代码来源:LanguageSeeder.php

示例12: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     $this->call('UserTableSeeder');
     $this->call('residenciasTableSeeder');
     $this->Call('AreasTableSeeder');
     $this->Call('FacturasTableSeeder');
     $this->Call('NoticiasTableSeeder');
     $this->Call('EncuestasTableSeeder');
     $this->Call('DirectivaTableSeeder');
     $this->Call('PersonalTableSeeder');
     $this->Call('SolvenciaTableSeeder');
     $this->Call('VehiculosTableSeeder');
     $this->Call('VisitantesTableSeeder');
     $this->Call('DocumentosTableSeeder');
     Eloquent::reguard();
 }
开发者ID:seedgabo,项目名称:condominio,代码行数:22,代码来源:DatabaseSeeder.php

示例13: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     $this->call('UserTableSeeder');
     Eloquent::reguard();
 }
开发者ID:jsdecena,项目名称:admin,代码行数:11,代码来源:DatabaseSeeder.php

示例14: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     $this->createRequirements();
     Eloquent::reguard();
 }
开发者ID:MUS3RP0L,项目名称:Plataforma-Virtual,代码行数:11,代码来源:RequirementTableSeeder.php

示例15: run

 public function run()
 {
     Eloquent::unguard();
     $this->createPaymentStatuses();
     Eloquent::reguard();
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:6,代码来源:PaymentStatusSeeder.php


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