/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // $pegawai = Pegawai::find($id); if ($pegawai->delete()) { return response()->json(array('success' => TRUE)); } }
public function Pegawai() { $listData = ArrayHelper::map(Pegawai::find()->where(['pegawai_type_id' => 2])->all(), 'id', 'nama'); return $listData; }