Cetaklabel/Database/Seeders/CetakLabelSeeder.php

69 lines
2.3 KiB
PHP
Raw Normal View History

2023-05-15 10:03:46 +00:00
<?php
2023-05-20 14:09:49 +00:00
namespace Modules\Cetaklabel\Database\Seeders;
2023-05-15 10:03:46 +00:00
use Faker\Generator;
use Illuminate\Database\Seeder;
2023-05-20 14:09:49 +00:00
use Modules\Cetaklabel\Entities\Directorat;
use Modules\Cetaklabel\Entities\Job;
use Modules\Cetaklabel\Entities\SpecialCode;
use Modules\Cetaklabel\Entities\SubDirectorat;
use Modules\Cetaklabel\Entities\SubJob;
use Modules\Cetaklabel\Entities\SubSubJob;
2023-05-15 10:03:46 +00:00
2023-05-20 14:09:49 +00:00
class CetaklabelSeeder extends Seeder
2023-05-15 10:03:46 +00:00
{
/**
* Run the database seeds.
*
* @return void
*/
public function run(Generator $faker)
{
2023-05-15 14:14:52 +00:00
$direktorat = Directorat::create([
2023-05-15 10:03:46 +00:00
'kode' => '01',
'name' => 'Direktorat Jenderal Perhubungan Darat',
]);
2023-05-15 14:14:52 +00:00
$subdirektorat = SubDirectorat::create([
2023-05-15 10:03:46 +00:00
'kode' => '01',
'name' => 'Subdirektorat Jenderal Perhubungan Darat',
'directorat_id' => $direktorat->id,
]);
2023-05-15 14:14:52 +00:00
$job = Job::create([
2023-05-15 10:03:46 +00:00
'kode' => '01',
'name' => 'Kepala Subdirektorat Jenderal Perhubungan Darat',
'sub_directorat_id' => $subdirektorat->id,
'directorat_id' => $direktorat->id,
]);
2023-05-15 14:14:52 +00:00
$subjob = SubJob::create([
2023-05-15 10:03:46 +00:00
'kode' => '01',
'name' => 'Kepala Subdirektorat Jenderal Perhubungan Darat',
'job_id' => $job->id,
'sub_directorat_id' => $subdirektorat->id,
'directorat_id' => $direktorat->id,
]);
2023-05-15 14:14:52 +00:00
$subsubjob = SubSubJob::create([
2023-05-15 10:03:46 +00:00
'kode' => '01',
'name' => 'Kepala Subdirektorat Jenderal Perhubungan Darat',
'sub_job_id' => $subjob->id,
'job_id' => $job->id,
'sub_directorat_id' => $subdirektorat->id,
'directorat_id' => $direktorat->id,
]);
2023-05-15 14:14:52 +00:00
$SpecialCode = SpecialCode::create([
2023-05-15 10:03:46 +00:00
'kode' => '00',
'name' => 'Archive'
]);
2023-05-15 14:14:52 +00:00
$SpecialCode = SpecialCode::create([
2023-05-15 10:03:46 +00:00
'kode' => '98',
'name' => 'Softcopy'
]);
}
}