27 lines
1004 B
PHP
27 lines
1004 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class HariSeeder extends Seeder
|
|
{
|
|
public function run()
|
|
{
|
|
$hariList = [
|
|
['id' => 1, 'nama_hari' => 'Senin', 'created_at' => now(), 'updated_at' => now()],
|
|
['id' => 2, 'nama_hari' => 'Selasa', 'created_at' => now(), 'updated_at' => now()],
|
|
['id' => 3, 'nama_hari' => 'Rabu', 'created_at' => now(), 'updated_at' => now()],
|
|
['id' => 4, 'nama_hari' => 'Kamis', 'created_at' => now(), 'updated_at' => now()],
|
|
['id' => 5, 'nama_hari' => 'Jumat', 'created_at' => now(), 'updated_at' => now()],
|
|
['id' => 6, 'nama_hari' => 'Sabtu', 'created_at' => now(), 'updated_at' => now()],
|
|
['id' => 7, 'nama_hari' => 'Minggu', 'created_at' => now(), 'updated_at' => now()],
|
|
];
|
|
|
|
foreach ($hariList as $hari) {
|
|
DB::table('hari')->updateOrInsert(['id' => $hari['id']], $hari);
|
|
}
|
|
}
|
|
}
|