當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。