80 lines
3.5 KiB
PHP
80 lines
3.5 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Modules\ProjectManagement\Models\ProjectClassification;
|
|
|
|
class ProjectClassificationSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Seed project classifications for construction projects.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$classifications = [
|
|
[
|
|
'code' => 'ROAD-HWY',
|
|
'name' => 'Road, Highway, Pavement, Railways, Airport Horizontal Structures and Bridges',
|
|
'description' => 'Horizontal infrastructure including roads, highways, pavements, railways, airport runways/taxiways, and bridges.',
|
|
],
|
|
[
|
|
'code' => 'IRR-FLD',
|
|
'name' => 'Irrigation and Flood Control',
|
|
'description' => 'Irrigation networks, canals, flood mitigation structures, drainage basins, and river dikes.',
|
|
],
|
|
[
|
|
'code' => 'DAM-RES',
|
|
'name' => 'Dam, Reservoir, and Tunneling',
|
|
'description' => 'Dam structures, water reservoirs, underground tunneling, and heavy subterranean excavation.',
|
|
],
|
|
[
|
|
'code' => 'WAT-SUP',
|
|
'name' => 'Water Supply',
|
|
'description' => 'Potable water transmission pipelines, distribution networks, pumping stations, and overhead storage tanks.',
|
|
],
|
|
[
|
|
'code' => 'PORT-ENG',
|
|
'name' => 'Port, Harbor and Offshore Engineering',
|
|
'description' => 'Seaport piers, wharves, harbor jetties, breakwaters, coastal protection, and offshore marine structures.',
|
|
],
|
|
[
|
|
'code' => 'BLD-PLANT',
|
|
'name' => 'Building and Industrial Plant',
|
|
'description' => 'Commercial, institutional, and high-rise residential buildings, manufacturing facilities, and heavy industrial plants.',
|
|
],
|
|
[
|
|
'code' => 'SEW-TREAT',
|
|
'name' => 'Sewerage Treatment / Disposal Plant',
|
|
'description' => 'Sewerage treatment plants, wastewater filtration facilities, and effluent disposal networks.',
|
|
],
|
|
[
|
|
'code' => 'WTR-TREAT',
|
|
'name' => 'Water Treatment Plant and System',
|
|
'description' => 'Raw water purification facilities, chemical dosing systems, and municipal water treatment plants.',
|
|
],
|
|
[
|
|
'code' => 'REC-PARK',
|
|
'name' => 'Park, Playground and Recreational Work',
|
|
'description' => 'Public community parks, open-air recreational sports facilities, playgrounds, and landscape civil works.',
|
|
],
|
|
[
|
|
'code' => 'ELEC-WRK',
|
|
'name' => 'Electrical Work',
|
|
'description' => 'High/medium voltage substations, transmission power lines, industrial switchgear, and civil-electrical infrastructure.',
|
|
],
|
|
];
|
|
|
|
// Clear existing items and re-seed the exact defined enumeration
|
|
\Illuminate\Support\Facades\Schema::disableForeignKeyConstraints();
|
|
DB::table('project_classification_pivot')->delete();
|
|
DB::table('project_classifications')->delete();
|
|
\Illuminate\Support\Facades\Schema::enableForeignKeyConstraints();
|
|
|
|
foreach ($classifications as $item) {
|
|
ProjectClassification::create($item);
|
|
}
|
|
}
|
|
}
|