/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // $pelatihan = Pelatihan::find($id); if ($pelatihan->delete()) { return Response::json(array('success' => TRUE)); } }
public function getNamaPelatihanAttribute() { $value = $this->attributes['id_master_pelatihan']; $data = Pelatihan::find($value); if ($data) { return $data->nama_pelatihan; } return '-'; }