本文整理汇总了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;');
}
示例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!!!!!!!!!!!!']);
}