Skip to content

Commit

Permalink
v_1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pratiksh404 committed Oct 18, 2020
1 parent 0f92b4f commit a5c71a7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,13 @@ then publish the package seeds
php artisan import:nepal
```

then call them in DatabaseSeeder.php
then migrate the tables

```sh
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
$this->call(ProvinceSeeder::class);
$this->call(DistrictSeeder::class);
$this->call(MunicipalitySeeder::class);
}
}
php artisan migrate
```

that's it you are good to go
that's it, you are good to go.

`Note` if seeder not found run `composer dump-autoload`

Expand Down
10 changes: 9 additions & 1 deletion config/LaraNepal.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@
|--------------------------------------------------------------------------
|
*/
'caching' => true
'caching' => true,

/*
|--------------------------------------------------------------------------
| Seed in migration
|--------------------------------------------------------------------------
|
*/
'seeding_while_migration' => true
];
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ public function up()
});

// Seeder Artisan Call
Artisan::call('db:seed', [
'--class' => ProvinceSeeder::class
]);
if (config('laranepal.seeding_while_migration', true)) {
Artisan::call('db:seed', [
'--class' => ProvinceSeeder::class
]);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ public function up()
});

// Seeder Artisan Call
Artisan::call('db:seed', [
'--class' => DistrictSeeder::class
]);
if (config('laranepal.seeding_while_migration', true)) {
Artisan::call('db:seed', [
'--class' => DistrictSeeder::class
]);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ public function up()
});

// Seeder Artisan Call
Artisan::call('db:seed', [
'--class' => MunicipalitySeeder::class
]);
if (config('laranepal.seeding_while_migration', true)) {
Artisan::call('db:seed', [
'--class' => MunicipalitySeeder::class
]);
}
}

/**
Expand Down

0 comments on commit a5c71a7

Please sign in to comment.