Initial commit: Struktur aplikasi ilycats
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Cat;
|
||||
use App\Models\Treatment;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class TreatmentSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$milo = Cat::where('nama_kucing', 'Milo')->first();
|
||||
$oliver = Cat::where('nama_kucing', 'Oliver')->first();
|
||||
|
||||
if ($milo) {
|
||||
Treatment::create([
|
||||
'cat_id' => $milo->id,
|
||||
'tanggal' => now()->subDays(2),
|
||||
'keluhan' => 'Bersin terus menerus',
|
||||
'nama_obat' => 'Flu-Cat Syrup',
|
||||
'dosis' => '0.5ml / 2x sehari',
|
||||
]);
|
||||
}
|
||||
|
||||
if ($oliver) {
|
||||
Treatment::create([
|
||||
'cat_id' => $oliver->id,
|
||||
'tanggal' => now()->subDay(),
|
||||
'keluhan' => 'Gatal di telinga',
|
||||
'nama_obat' => 'Salep Scabies',
|
||||
'dosis' => 'Oles tipis pagi/malam',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user