本文整理匯總了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!!!!!!!!!!!!']);
}