simedkom/database/seeders/ContentRecapClassificationSeeder.php
2025-10-13 08:35:36 +07:00

32 lines
1.1 KiB
PHP

<?php
namespace Database\Seeders;
use App\Models\ContentRecapClassification;
use App\Models\Legacy\OldContentRecapClassification;
use Illuminate\Database\Seeder;
class ContentRecapClassificationSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$legacyContentRecapClassifications = OldContentRecapClassification::all();
foreach ($legacyContentRecapClassifications as $legacyContentRecapClassification) {
ContentRecapClassification::create([
'id' => $legacyContentRecapClassification->id,
'name' => $legacyContentRecapClassification->name,
'slug' => slugify($legacyContentRecapClassification->name.' '.$legacyContentRecapClassification->year),
'year' => $legacyContentRecapClassification->year,
'created_at' => $legacyContentRecapClassification->created_at,
'updated_at' => $legacyContentRecapClassification->updated_at,
'deleted_at' => $legacyContentRecapClassification->deleted_at,
'enhancer_id' => 1,
]);
}
}
}