49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Location;
|
|
use App\Models\MaterialQuality;
|
|
use App\Models\PackagingMaterial;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class InventoryStammdatenSeeder extends Seeder
|
|
{
|
|
public function run(): void
|
|
{
|
|
$locations = ['Köln', 'Waldböl'];
|
|
foreach ($locations as $name) {
|
|
Location::query()->firstOrCreate(
|
|
['name' => $name],
|
|
['active' => true]
|
|
);
|
|
}
|
|
|
|
$qualities = [
|
|
'konventionell',
|
|
'bio kaltgepresst',
|
|
'bio raffiniert',
|
|
'konventionell kaltgepresst',
|
|
'konventionell raffiniert',
|
|
];
|
|
foreach ($qualities as $pos => $name) {
|
|
MaterialQuality::query()->firstOrCreate(
|
|
['name' => $name],
|
|
['pos' => $pos]
|
|
);
|
|
}
|
|
|
|
$materials = [
|
|
'Glas',
|
|
'Holz/Bambus',
|
|
'Pappe/Papier',
|
|
'Kunststoff',
|
|
];
|
|
foreach ($materials as $pos => $name) {
|
|
PackagingMaterial::query()->firstOrCreate(
|
|
['name' => $name],
|
|
['pos' => $pos]
|
|
);
|
|
}
|
|
}
|
|
}
|