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


PHP Eloquent::unguard方法代码示例

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


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

示例1: run

 public function run()
 {
     Eloquent::unguard();
     DB::table('clinics')->delete();
     Clinic::create(['name' => 'Apollo', 'x_coord' => '12.45', 'y_coord' => '54.23', 'address' => 'Delhi', 'email' => 'apollo', 'description' => 'apollo']);
     Clinic::create(['name' => 'Fortis', 'x_coord' => '56.45', 'y_coord' => '32.23', 'address' => 'Noida', 'email' => 'fortis', 'description' => 'fortis']);
 }
开发者ID:shubhomoy,项目名称:evolve,代码行数:7,代码来源:ClinicTableSeeder.php

示例2: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     //$this->call('UserTableSeeder');
     //$this->call('UserGroupSeeder');
     $this->call('PostCommentSeeder');
 }
开发者ID:rituzy,项目名称:iblog,代码行数: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->call('RangeCronJobsTableSeeder');
     $this->call('UserMgmtTablesSeeder');
     $this->call('AddTypesTableSeeder');
 }
开发者ID:ryanrobertsname,项目名称:giftertipster.com,代码行数:12,代码来源:DatabaseSeeder.php

示例5: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     DB::table('tags')->truncate();
     //DB::table('pastes')->truncate();
     $faker = Faker\Factory::create();
     $paste_count = 10;
     $tags = array('php', 'javascript', 'ruby', 'js', 'cpp', 'c++', 'c#', 'go', 'html', 'css');
     for ($i = 0; $i < $paste_count; $i++) {
         $tags_per_paste = rand(1, 3);
         // Generate the paste
         $examplePaste = new Paste();
         $examplePaste->paste = $faker->paragraph;
         $examplePaste->title = $faker->realText(46);
         $examplePaste->expire = $faker->dateTime($max = 'now');
         $examplePaste->token = Str::random(40);
         $examplePaste->private = rand(0, 1);
         $examplePaste->delete_token = Str::random(40);
         $examplePaste->save();
         // Attach some tags to the new paste
         for ($i = 0; $i < $tags_per_paste; ++$i) {
             $exampleTag = new Tag();
             $exampleTag->tag = $tags[rand(0, sizeof($tags) - 1)];
             $exampleTag->paste_id = $examplePaste->id;
             $examplePaste->tags()->save($exampleTag);
         }
         print "Seeded paste with ID of " . $examplePaste->id . "\n";
     }
 }
开发者ID:dwbfox,项目名称:pasteboard,代码行数:34,代码来源:DatabaseSeeder.php

示例6: run

 public function run()
 {
     Eloquent::unguard();
     DB::table('years')->delete();
     Year::create(['id' => 1, 'year' => 2015, 'nombre_colegio' => 'LICEO ADVENTISTA LIBERTAD', 'abrev_colegio' => 'LAL', 'nota_minima_aceptada' => 70, 'resolucion' => 'RESOLUCIÓN 2563 DE 2014', 'actual' => true, 'alumnos_can_see_notas' => true]);
     $this->command->info("Año 2014 y 2015 agregados.");
     /* OTRA FORMA ********************************************************************
     		// Abrimos el archivo donde tengo los municipios restantes de Colombia
     		// recorremos los registros y los ingresamos a la base de datos
     		$this->command->info("Leemos los csv para las cuidades colombianas faltantes...");
     
     		$csv = dirname(__FILE__) .'/SqlTables/CuidadesDeColombia.csv'; 
     		$file_handle = fopen($csv, "r");
     
     		while (!feof($file_handle)) {
     		    $line = fgetcsv($file_handle);
     
     		    if (empty($line)) {
     		        continue; // skip blank lines
     		    }
     
     		    $c = array();
     		    $c['nombre']		= $line[0];
     		    $c['pais_codigo']	= $line[1];
     		    $c['distrito']		= $line[2];
     		    $c['poblacion']		= $line[3];
     
     		    //$this->command->info( implode(",", $c));
     		    DB::table('ciudads')->insert($c);
     		}
     		fclose($file_handle);
     */
 }
开发者ID:bluesky777,项目名称:5myvc,代码行数:33,代码来源:YearsTableSeeder.php

示例7: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $this->cleanDatabase();
     Eloquent::unguard();
     $this->call(EventsSeeder::class);
     $this->call(FishingSectorsSeeder::class);
     $this->call(FishingLocationsSeeder::class);
     $this->call(FishingCategoriesSeeder::class);
     $this->call(UsersCategoriesSeeder::class);
     $this->call(UsersRolesSeeder::class);
     $this->call(UsersPermissionsSeeder::class);
     $this->call(UsersClubsSeeder::class);
     $this->call(UsersSeeder::class);
     $this->call(UsersAddressesSeeder::class);
     $this->call(UsersAvatarsSeeder::class);
     $this->call(UsersTeamsSeeder::class);
     $this->call(SpeciesTypesSeeder::class);
     $this->call(SpeciesSeeder::class);
     $this->call(SpeciesWeightsSeeder::class);
     //$this->call(WeighInsSeeder::class);
     $this->call(WeighInsSitesSeeder::class);
     //$this->call(WeighInsUserEntryDetailsSeeder::class);
     //$this->call(WeighInsEntriesSeeder::class);
     // Make sure pivot tables get seeded last!
     $this->call(UsersPivotRolePermissionSeeder::class);
     $this->call(UsersPivotUserCategorySeeder::class);
     $this->call(UsersPivotTeamUserSeeder::class);
     //$this->call(WeighInsPivotEntryCategorySeeder::class);
     $this->call(BoatsSeeder::class);
 }
开发者ID:sularz-maciej,项目名称:psaa-fishing-festival,代码行数:35,代码来源:DatabaseSeeder.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     // $this->call('UserTableSeeder');
     $this->call('SentrySeeder');
     $this->command->info('Sentry tables seeded!');
 }
开发者ID:kettanyam,项目名称:20141001done,代码行数:12,代码来源:DatabaseSeeder.php

示例9: 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

示例10: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     $this->call('ConfiguracionSeeder');
     $this->call('NivelAcademicoTableSeeder');
     $this->call('OrganismoTableSeeder');
     $this->call('ParentescoTableSeeder');
     $this->call('RecepcionTableSeeder');
     $this->call('ReferenteTableSeeder');
     $this->call('TenenciaTableSeeder');
     $this->call('TipoAyudaTableSeeder');
     //$this->call('AreaTableSeeder');
     $this->call('TipoViviendaTableSeeder');
     //$this->call('RecaudoTableSeeder');
     $this->call('TipoNacionalidadTableSeeder');
     $this->call('EstadoCivilTableSeeder');
     $this->call('TipoRequerimientoTableSeeder');
     $this->call('ProcesoTableSeeder');
     $this->call('RequerimientoTableSeeder');
     $this->call('EstadoTableSeeder');
     $this->call('MunicipioTableSeeder');
     $this->call('ParroquiaTableSeeder');
     $this->call('GruposTableSeeder');
     $this->call('DepartamentoTableSeeder');
     $this->call('UsersTableSeeder');
 }
开发者ID:armandolazarte,项目名称:sasyc,代码行数:31,代码来源:DatabaseSeeder.php

示例11: run

 public function run()
 {
     \Eloquent::unguard();
     \DB::table(\Config::get('vcms5.pages_table'))->delete();
     Page::create(array('page_title' => 'Home', 'page_content' => 'This is the home page.', 'page_title_fr' => 'Accueil', 'page_content_fr' => 'This is the home page in French.', 'page_title_es' => 'Incio', 'page_content_es' => 'This is the home page in Spanish.', 'active' => '1', 'meta' => 'meta', 'slug' => 'home', 'slug_fr' => 'accueil', 'slug_es' => 'incio', 'meta_tags' => 'tags'));
     \DB::table(\Config::get('vcms5.menus_table'))->delete();
     Menu::create(array('menu_name' => 'Main Menu'));
     \DB::table(\Config::get('vcms5.menu_items_table'))->delete();
     MenuItem::create(array('menu_id' => '1', 'menu_text_en' => 'Home', 'menu_text_fr' => 'Home', 'menu_text_es' => 'Home', 'url' => '', 'active' => '1', 'has_children' => '0', 'sort_order' => '1', 'page_id' => '1'));
     \DB::table(\Config::get('vcms5.roles_table'))->delete();
     Role::create(array('id' => '1', 'role_name' => 'Manage Pages', 'role' => 'pages'));
     Role::create(array('id' => '2', 'role_name' => 'Manage Calendar Events', 'role' => 'events'));
     Role::create(array('id' => '3', 'role_name' => 'Manage Blogs', 'role' => 'blogs'));
     Role::create(array('id' => '4', 'role_name' => 'Manage Galleries', 'role' => 'galleries'));
     Role::create(array('id' => '5', 'role_name' => 'Manage Users', 'role' => 'users'));
     Role::create(array('id' => '6', 'role_name' => 'Manage Menus', 'role' => 'menus'));
     Role::create(array('id' => '7', 'role_name' => 'Manage News', 'role' => 'news'));
     Role::create(array('id' => '8', 'role_name' => 'Manage FAQs', 'role' => 'faqs'));
     \DB::table('users')->delete();
     User::create(array('id' => '1', 'email' => 'trevor.sawler@me.com', 'first_name' => 'Trevor', 'last_name' => 'Sawler', 'password' => \Hash::make('marlow11'), 'user_active' => 1, 'access_level' => 3));
     \DB::table(\Config::get('vcms5.user_roles_table'))->delete();
     UserRole::create(array('id' => '1', 'user_id' => '1', 'role_id' => '1', 'role' => 'pages'));
     UserRole::create(array('id' => '2', 'user_id' => '1', 'role_id' => '2', 'role' => 'events'));
     UserRole::create(array('id' => '3', 'user_id' => '1', 'role_id' => '3', 'role' => 'blogs'));
     UserRole::create(array('id' => '4', 'user_id' => '1', 'role_id' => '4', 'role' => 'galleries'));
     UserRole::create(array('id' => '5', 'user_id' => '1', 'role_id' => '5', 'role' => 'users'));
     UserRole::create(array('id' => '6', 'user_id' => '1', 'role_id' => '6', 'role' => 'menus'));
     UserRole::create(array('id' => '7', 'user_id' => '1', 'role_id' => '7', 'role' => 'news'));
     UserRole::create(array('id' => '8', 'user_id' => '1', 'role_id' => '8', 'role' => 'faqs'));
 }
开发者ID:tsawler,项目名称:sdhs.ca,代码行数:30,代码来源:VcmsDefaultTableSeeder.php

示例12: run

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

示例13: edit

 public function edit($item)
 {
     $dbs = new DBconnect();
     $doc = $dbs->find($item);
     $post = Input::get();
     //remove csrf token
     if (array_key_exists('_token', $post)) {
         unset($post['_token']);
     }
     Eloquent::unguard();
     if ($doc) {
         if ($doc->update($post)) {
             return Response::json(array('message' => 'success'));
         } else {
             return Response::json(array('message' => 'error'));
         }
     } else {
         $doc = $dbs->where('memberName', $item);
         if (isset($doc->get()[0])) {
             if ($doc->update($post)) {
                 return Response::json(array('message' => 'success'));
             } else {
                 return Response::json(array('message' => 'error'));
             }
         } else {
             return Response::json(array('message' => 'not found'));
         }
     }
 }
开发者ID:balmmyy,项目名称:LaravelTest,代码行数:29,代码来源:MemberController.php

示例14: run

 /**
  * Run the Profiles table seeds.
  *
  * @return void
  */
 public function run()
 {
     Eloquent::unguard();
     Profile::create(['id' => 1, 'user_id' => 1, 'bio' => 'I like to soccer, women, and beer.', 'location' => 'Long Beach, CA', 'twitter_username' => 'johnsfeed', 'instagram_username' => 'johnwashere']);
     Profile::create(['id' => 2, 'user_id' => 2, 'bio' => 'I like to cooking, reading, and swimming.', 'location' => 'Oceanside, CA', 'twitter_username' => 'karenwho', 'instagram_username' => 'karenthequeen']);
     Profile::create(['id' => 3, 'user_id' => 3, 'bio' => 'I like eating raw food and yoga.', 'location' => 'San Francisco, CA', 'twitter_username' => 'janesworld', 'instagram_username' => 'janedidit']);
 }
开发者ID:adrianapope,项目名称:baking-amigo,代码行数:12,代码来源:ProfilesSeeder.php

示例15: run

 public function run()
 {
     Eloquent::unguard();
     // DB::table('packages')->delete();
     $currentDate = date('Y-m-d');
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 5 days')), 'booking_time' => '01:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 5 days')), 'booking_time' => '23:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 10 days')), 'booking_time' => '13:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 10 days')), 'booking_time' => '14:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 11 days')), 'booking_time' => '13:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 11 days')), 'booking_time' => '16:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 12 days')), 'booking_time' => '10:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 12 days')), 'booking_time' => '14:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 13 days')), 'booking_time' => '16:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 13 days')), 'booking_time' => '17:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 14 days')), 'booking_time' => '13:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 14 days')), 'booking_time' => '11:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 15 days')), 'booking_time' => '12:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 15 days')), 'booking_time' => '13:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 16 days')), 'booking_time' => '16:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 16 days')), 'booking_time' => '19:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 17 days')), 'booking_time' => '13:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 17 days')), 'booking_time' => '14:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 17 days')), 'booking_time' => '15:00'));
     BookingTimes::create(array('booking_date' => date('Y-m-d', strtotime($currentDate . ' + 17 days')), 'booking_time' => '16:00'));
 }
开发者ID:RetinaInc,项目名称:booking-app,代码行数:26,代码来源:BookingTimesTableSeeder.php


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