Skip to content

Commit 0f92b4f

Browse files
committed
v_1.0.1
1 parent afaa296 commit 0f92b4f

8 files changed

+28
-58
lines changed

database/migrations/2020_10_14_000000_create_provinces_table.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22

3-
use Illuminate\Database\Migrations\Migration;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Support\Facades\Artisan;
5+
use Illuminate\Database\Schema\Blueprint;
6+
use Illuminate\Database\Migrations\Migration;
67

78
class CreateProvincesTable extends Migration
89
{
@@ -22,6 +23,11 @@ public function up()
2223
$table->string('image')->nullable();
2324
$table->timestamps();
2425
});
26+
27+
// Seeder Artisan Call
28+
Artisan::call('db:seed', [
29+
'--class' => ProvinceSeeder::class
30+
]);
2531
}
2632

2733
/**

database/migrations/2020_10_14_000099_create_districts_table.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22

3-
use Illuminate\Database\Migrations\Migration;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Support\Facades\Artisan;
5+
use Illuminate\Database\Schema\Blueprint;
6+
use Illuminate\Database\Migrations\Migration;
67

78
class CreateDistrictsTable extends Migration
89
{
@@ -22,6 +23,11 @@ public function up()
2223
$table->foreign('province_id')->references('id')->on('provinces');
2324
$table->timestamps();
2425
});
26+
27+
// Seeder Artisan Call
28+
Artisan::call('db:seed', [
29+
'--class' => DistrictSeeder::class
30+
]);
2531
}
2632

2733
/**

database/migrations/2020_10_14_000100_create_municipalities_table.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22

3-
use Illuminate\Database\Migrations\Migration;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Support\Facades\Artisan;
5+
use Illuminate\Database\Schema\Blueprint;
6+
use Illuminate\Database\Migrations\Migration;
67

78
class CreateMunicipalitiesTable extends Migration
89
{
@@ -21,6 +22,11 @@ public function up()
2122
$table->foreign('district_name')->references('name')->on('districts')->onDelete('cascade');
2223
$table->timestamps();
2324
});
25+
26+
// Seeder Artisan Call
27+
Artisan::call('db:seed', [
28+
'--class' => MunicipalitySeeder::class
29+
]);
2430
}
2531

2632
/**

database/seeds/DistrictSeeder.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use Illuminate\Database\Seeder;
4-
use Pratiksh\LaraNepal\Models\District;
54

65
class DistrictSeeder extends Seeder
76
{
@@ -515,8 +514,6 @@ public function run()
515514
$province_7,
516515
);
517516

518-
foreach ($districts as $district) {
519-
District::create($district);
520-
}
517+
DB::table('districts')->insert($districts);
521518
}
522519
}

database/seeds/MunicipalitySeeder.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
use Illuminate\Database\Seeder;
4-
use Pratiksh\LaraNepal\Models\Municipality;
4+
use Illuminate\Support\Facades\DB;
55

66
class MunicipalitySeeder extends Seeder
77
{
@@ -1425,8 +1425,6 @@ public function run()
14251425
]
14261426
];
14271427

1428-
foreach ($municipalities as $municipality) {
1429-
Municipality::create($municipality);
1430-
}
1428+
DB::table('municipalities')->insert($municipalities);
14311429
}
14321430
}

database/seeds/ProvinceSeeder.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22

3-
43
use Illuminate\Database\Seeder;
5-
use Pratiksh\LaraNepal\Models\Province;
64

75
class ProvinceSeeder extends Seeder
86
{
@@ -65,8 +63,6 @@ public function run()
6563
],
6664
];
6765

68-
foreach ($provinces as $province) {
69-
Province::create($province);
70-
}
66+
DB::table('provinces')->insert($provinces);
7167
}
7268
}

tests/Feature/ExampleTest.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/Unit/ExampleTest.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)