28 lines
849 B
PHP
28 lines
849 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Database\Seeders;
|
||
|
|
|
||
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||
|
|
use Illuminate\Database\Seeder;
|
||
|
|
|
||
|
|
class CategorySeeder extends Seeder
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Run the database seeds.
|
||
|
|
*/
|
||
|
|
public function run(): void
|
||
|
|
{
|
||
|
|
$data = [
|
||
|
|
['name' => 'Antibiotik', 'keywords' => 'amoxicillin, clavamox, doxycycline, antibiotic'],
|
||
|
|
['name' => 'Antiparasit', 'keywords' => 'worm, cacing, flea, kutu, revolution, drontal'],
|
||
|
|
['name' => 'Vitamin', 'keywords' => 'stimuno, nutriplus, fish oil, minyak ikan, calcium'],
|
||
|
|
['name' => 'Vaksin', 'keywords' => 'tricat, felocell, rabies, purevax'],
|
||
|
|
['name' => 'Flu & Batuk', 'keywords' => 'flu, batuk, contracold, iliadin'],
|
||
|
|
];
|
||
|
|
|
||
|
|
foreach ($data as $item) {
|
||
|
|
\App\Models\Category::updateOrCreate(['name' => $item['name']], $item);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|