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