45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class EdiCategoriesSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
|
|
Schema::disableForeignKeyConstraints();
|
|
DB::table('edi_categories')->truncate();
|
|
Schema::enableForeignKeyConstraints();
|
|
|
|
$ediCategories = [
|
|
[
|
|
'value' => 'SINGLE',
|
|
'regex_pattern' => '^[\\w\\s-]*\\b(?:single|so)\\b'
|
|
], //1
|
|
['value' => 'SINGLE-OP', 'regex_pattern' => '' ], //2
|
|
['value' => 'SO', 'regex_pattern' => '' ], //3
|
|
['value' => 'SINGLE QRP', 'regex_pattern' => '' ], //4
|
|
['value' => 'SO-LP', 'regex_pattern' => '' ], //5
|
|
['value' => 'MULTI', 'regex_pattern' => '^[\w\s-]*\b(?:multi|mo)\b' ], //6
|
|
['value' => 'MO-LP', 'regex_pattern' => '' ], //7
|
|
['value' => 'CHECK', 'regex_pattern' => '' ], //8
|
|
['value' => 'CHECKLOG', 'regex_pattern' => '' ], //9
|
|
];
|
|
|
|
foreach ($ediCategories as &$ediCategory) {
|
|
$ediCategory['created_at'] = now();
|
|
$ediCategory['updated_at'] = now();
|
|
};
|
|
|
|
DB::table('edi_categories')->insert($ediCategories);
|
|
}
|
|
}
|