private static function getJumlahAduanClosedByCategory($date, $id_kategori) { $idStatus = StatusModel::where('nama', 'closed')->first()['id']; $aduan = PengaduanModel::all(); $jumlah = 0; foreach ($aduan as $temp) { $createdAt = $temp['created_at'] . ""; if (strpos($createdAt, $date) !== false && $temp['id_status'] == $idStatus && $temp['id_kategori'] == $id_kategori) { $jumlah++; } } return $jumlah; }
public function kirim($slug) { $idStatus = StatusModel::where('nama', 'forwarded')->first()['id']; Pengaduan::updateStatus($slug, $idStatus, NULL); return redirect('pengaduan/' . $slug)->with('message', 'PENGADUAN TERKIRIM'); }