34 lines
975 B
PHP
34 lines
975 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Legacy\OldSubLocation;
|
|
use App\Models\SubLocation;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Str;
|
|
|
|
class SubLocationSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$legacySubLocations = OldSubLocation::all();
|
|
|
|
foreach($legacySubLocations as $legacySubLocation){
|
|
SubLocation::create([
|
|
'id' => $legacySubLocation->id,
|
|
'name' => $legacySubLocation->name,
|
|
'description' => null,
|
|
'status' => $legacySubLocation->status,
|
|
'enhancer_id' => $legacySubLocation->enhancer,
|
|
'created_at' => $legacySubLocation->created_at,
|
|
'updated_at' => $legacySubLocation->updated_at,
|
|
'location_id' => $legacySubLocation->locus,
|
|
]);
|
|
}
|
|
}
|
|
}
|