/**
  * Delete detail feature.
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function deleteDetailFeature($id)
 {
     $detailfeature = DetailFeature::find($id);
     $detailfeature->employees()->detach();
     $detailfeature->delete();
     return redirect()->route('manageproject.index')->with('messageOk', 'Delete detail feature successfully!');
 }
예제 #2
0
 /**
  * Post save data.
  * @param Request $request [description]
  */
 public function destroy(Request $request, $table = '', $id)
 {
     DB::table($table)->where('id', $id)->delete();
     $idFirst = DB::table($table)->first()->id;
     DetailFeature::where($table . '_id', $id)->update([$table . '_id' => $idFirst]);
     return redirect(route('crud.index', $table));
 }