Skip to content

Commit

Permalink
bug fix categories seeder
Browse files Browse the repository at this point in the history
  • Loading branch information
fherryfherry committed Oct 5, 2016
1 parent 6a38978 commit 2bd71b2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/database/seeds/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,15 @@ public function run() {

class Cms_postscategoriesSeeder extends Seeder {
public function run() {

if(DB::table('cms_users')->count() == 0) {
if(DB::table('cms_posts_categories')->count() == 0) {
$faker = Faker\Factory::create();
$id_cms_users = DB::table('cms_users')->lists('id');
$id_cms_posts_categories = DB::table('cms_posts_categories')->lists('id');
for($i=1;$i<=5;$i++) {
$a = array();
$a = array();
$a['created_at'] = $faker->dateTimeBetween('-1 months','now');
$a['name'] = $faker->words(3,true);
$a['name'] = $faker->words(3,true);
DB::table('cms_posts_categories')->insert($a);
}
}

}
}
}

Expand Down

0 comments on commit 2bd71b2

Please sign in to comment.