public function getNamaEselonAttribute() { $name = $this->attributes['id_eselon']; $data = Eselon::find($name); if ($data) { return $data->nama_eselon; } return '-'; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // $eselon = Eselon::find($id); if ($eselon->delete()) { return Response::json(array('success' => TRUE)); } }