コード例 #1
0
 public function getNamaEselonAttribute()
 {
     $name = $this->attributes['id_eselon'];
     $data = Eselon::find($name);
     if ($data) {
         return $data->nama_eselon;
     }
     return '-';
 }
コード例 #2
0
 /**
  * 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));
     }
 }