本文整理汇总了PHP中app\Language::truncate方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::truncate方法的具体用法?PHP Language::truncate怎么用?PHP Language::truncate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Language
的用法示例。
在下文中一共展示了Language::truncate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
User::truncate();
Book::truncate();
BookClub::truncate();
Publisher::truncate();
Category::truncate();
Language::truncate();
// $this->call(UserTableSeeder::class);
// factory(User::class, 5)->create();
$this->call(UserTableSeeder::class);
factory(Book::class, 14)->create();
factory(BookClub::class, 6)->create();
factory(Category::class, 3)->create();
factory(Publisher::class, 3)->create();
factory(Language::class, 3)->create();
DB::table('book_statuses')->insert(['name' => 'Available']);
DB::table('book_statuses')->insert(['name' => 'Not Available']);
Model::reguard();
}
示例2: run
public function run()
{
Language::truncate();
Language::create(['name' => 'English', 'iso_code' => 'en', 'language_code' => 'en-en', 'date_format_lite' => 'm/j/Y', 'date_format_full' => 'm/j/Y H:i:s', 'date_format_lite_view' => 'm/j/Y', 'date_format_full_view' => 'm/j/Y H:i:s', 'active' => '1', 'created_at' => \Carbon\Carbon::createFromDate(2015, 04, 01)->toDateTimeString(), 'updated_at' => \Carbon\Carbon::now()->toDateTimeString()]);
Language::create(['name' => 'Español', 'iso_code' => 'es', 'language_code' => 'es-es', 'date_format_lite' => 'd/m/Y', 'date_format_full' => 'd/m/Y H:i:s', 'date_format_lite_view' => 'd/m/Y', 'date_format_full_view' => 'd/m/Y H:i:s', 'active' => '1', 'created_at' => \Carbon\Carbon::createFromDate(2015, 04, 01)->toDateTimeString(), 'updated_at' => \Carbon\Carbon::now()->toDateTimeString()]);
}