31 lines
789 B
PHP
31 lines
789 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Legacy\OldLocation;
|
|
use App\Models\Location;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class LocationSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$legacyLocations = OldLocation::all();
|
|
|
|
foreach ($legacyLocations as $legacyLocation) {
|
|
Location::create([
|
|
'id' => $legacyLocation->id,
|
|
'name' => $legacyLocation->name,
|
|
'description' => null,
|
|
'status' => $legacyLocation->status,
|
|
'enhancer_id' => $legacyLocation->enhancer,
|
|
'created_at' => $legacyLocation->created_at,
|
|
'updated_at' => $legacyLocation->updated_at,
|
|
]);
|
|
}
|
|
}
|
|
}
|