first(); $diliman = Barangay::where('code', 'QC-DLM')->first(); $commonwealth = Barangay::where('code', 'QC-CMW')->first(); $ermita = Barangay::where('code', 'MNL-ERM')->first(); $poblacion = Barangay::where('code', 'MKT-PBL')->first(); $hours = [ 'mon' => ['open' => '06:00', 'close' => '18:00'], 'tue' => ['open' => '06:00', 'close' => '18:00'], 'wed' => ['open' => '06:00', 'close' => '18:00'], 'thu' => ['open' => '06:00', 'close' => '18:00'], 'fri' => ['open' => '06:00', 'close' => '18:00'], 'sat' => ['open' => '07:00', 'close' => '15:00'], 'sun' => null, ]; $waste = ['general', 'recyclable', 'biodegradable']; $dops = [ ['code' => 'DOP-QC-BPA-01', 'name' => 'Bagong Pag-asa Plaza', 'barangay' => $bagongPagAsa, 'lat' => 14.6493, 'lng' => 121.0386, 'capacity' => 800], ['code' => 'DOP-QC-DLM-01', 'name' => 'Diliman Triangle DOP', 'barangay' => $diliman, 'lat' => 14.6539, 'lng' => 121.0685, 'capacity' => 1200], ['code' => 'DOP-QC-CMW-01', 'name' => 'Commonwealth Market DOP', 'barangay' => $commonwealth, 'lat' => 14.6970, 'lng' => 121.0780, 'capacity' => 1500], ['code' => 'DOP-MNL-ERM-01', 'name' => 'Ermita Drop-off Center', 'barangay' => $ermita, 'lat' => 14.5824, 'lng' => 120.9831, 'capacity' => 600], ['code' => 'DOP-MKT-PBL-01', 'name' => 'Poblacion Eco Hub', 'barangay' => $poblacion, 'lat' => 14.5648, 'lng' => 121.0306, 'capacity' => 700], ]; foreach ($dops as $d) { DropOffPoint::updateOrCreate( ['code' => $d['code']], [ 'name' => $d['name'], 'barangay_id' => $d['barangay']?->id, 'coordinates' => new Point($d['lat'], $d['lng'], 4326), 'address_line' => $d['name'].' (sample)', 'capacity_kg' => $d['capacity'], 'operating_hours' => $hours, 'accepted_waste_types' => $waste, 'status' => DropOffPoint::STATUS_ACTIVE, 'contact_person' => 'LGU Caretaker', 'contact_phone' => '+63281000000', ], ); } } }