Core/Modules/CetakLabel/Database/Seeders/CetakLabelSeeder.php

69 lines
2.1 KiB
PHP
Raw Normal View History

2023-04-14 07:50:22 +00:00
<?php
2023-05-11 01:29:47 +00:00
namespace Modules\CetakLabel\Database\Seeders;
2023-04-14 07:50:22 +00:00
use App\Models\Job;
2023-04-17 15:17:11 +00:00
use App\Models\SpecialCode;
2023-04-14 07:50:22 +00:00
use App\Models\SubDirectorat;
use App\Models\SubJob;
use App\Models\SubSubJob;
2023-04-14 07:50:22 +00:00
use Faker\Generator;
use Illuminate\Database\Seeder;
2023-05-11 01:29:47 +00:00
use Modules\CetakLabel\Entities\Directorat;
2023-04-14 07:50:22 +00:00
2023-05-11 01:29:47 +00:00
class CetakLabelSeeder extends Seeder
2023-04-14 07:50:22 +00:00
{
/**
* Run the database seeds.
*
* @return void
*/
public function run(Generator $faker)
{
$direktorat = Directorat::create([
'kode' => '01',
'name' => 'Direktorat Jenderal Perhubungan Darat',
]);
$subdirektorat = SubDirectorat::create([
'kode' => '01',
'name' => 'Subdirektorat Jenderal Perhubungan Darat',
'directorat_id' => $direktorat->id,
]);
$job = Job::create([
'kode' => '01',
'name' => 'Kepala Subdirektorat Jenderal Perhubungan Darat',
'sub_directorat_id' => $subdirektorat->id,
'directorat_id' => $direktorat->id,
]);
$subjob = SubJob::create([
'kode' => '01',
'name' => 'Kepala Subdirektorat Jenderal Perhubungan Darat',
'job_id' => $job->id,
'sub_directorat_id' => $subdirektorat->id,
'directorat_id' => $direktorat->id,
]);
$subsubjob = SubSubJob::create([
'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-04-17 15:17:11 +00:00
$SpecialCode = SpecialCode::create([
'kode' => '00',
'name' => 'Archive'
]);
$SpecialCode = SpecialCode::create([
'kode' => '98',
'name' => 'Softcopy'
]);
2023-04-14 07:50:22 +00:00
}
}