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


PHP Address::truncate方法代码示例

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


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

示例1: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //Truncate
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     User::truncate();
     Admin::truncate();
     Customer::truncate();
     Address::truncate();
     Category::truncate();
     Product::truncate();
     Brand::truncate();
     Type::truncate();
     Image::truncate();
     DB::statement('TRUNCATE category_product;');
     Product::clearIndices();
     Product::reindex();
     //Unguard
     Model::unguard();
     //Call
     $this->call(UsersTableSeeder::class);
     $this->call(ProductsTableSeeder::class);
     //Reguard
     Model::reguard();
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
 }
开发者ID:jentleyow,项目名称:megadeal,代码行数:30,代码来源:DatabaseSeeder.php

示例2: run

 public function run()
 {
     Address::truncate();
     Address::create(['user_id' => '1', 'address1' => 'T Nagar', 'address2' => 'New York', 'city' => 'Melbourne', 'state' => 'Dubai', 'country' => 'USA', 'pin' => '4213456', 'phone' => '7234556', 'landmark' => 'Lifes easy']);
     Address::create(['user_id' => '2', 'address1' => 'Anna Nagar', 'address2' => 'Yorkshire', 'city' => 'canberra', 'state' => 'Chennai', 'country' => 'UFA', 'pin' => '43433', 'phone' => '533336', 'landmark' => 'world easy']);
     Address::create(['user_id' => '3', 'address1' => 'Srinagar', 'address2' => 'New Jersey', 'city' => 'Stockholm', 'state' => 'Dublin', 'country' => 'SA', 'pin' => '13456', 'phone' => '4556', 'landmark' => 'Lifes Tough']);
     Address::create(['user_id' => '4', 'address1' => 'Tilak Nagar', 'address2' => 'New Delhi', 'city' => 'Qatar', 'state' => 'New Castle', 'country' => 'Canada', 'pin' => '456', 'phone' => '756', 'landmark' => 'Too easy']);
     Address::create(['user_id' => '5', 'address1' => 'Nagar', 'address2' => 'York', 'city' => 'bourne', 'state' => 'Duai', 'country' => 'SAE', 'pin' => '42456', 'phone' => '756', 'landmark' => 'Lifes!!!!!!!!!!!!']);
 }
开发者ID:surajch,项目名称:ensue-me,代码行数:9,代码来源:AddressTableSeeder.php


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