Files
snipe-it/app/database/seeds/CategoriesSeeder.php
T
snipe 1d50724c91 Removed parent from category
Since the field was already removed
2013-11-26 01:15:25 -05:00

58 lines
1.1 KiB
PHP

<?php
class CategoriesSeeder extends Seeder {
public function run()
{
$date = new DateTime;
$category[] = array(
'name' => 'Laptops',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
);
$date = new DateTime;
$category[] = array(
'name' => 'Desktops',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
);
$date = new DateTime;
$category[] = array(
'name' => 'Tablets',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
);
$date = new DateTime;
$category[] = array(
'name' => 'Phones',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
);
$date = new DateTime;
$category[] = array(
'name' => 'Monitors',
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 1,
);
// Delete all the blog posts
DB::table('categories')->truncate();
// Insert the blog posts
Category::insert($category);
}
}