/**
  * Remove the specified Element from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $element = $this->elementRepository->find($id);
     if (empty($element)) {
         Flash::error('Element not found');
         return redirect(route('elements.index'));
     }
     $this->elementRepository->delete($id);
     Flash::success('Element deleted successfully.');
     return redirect(route('elements.index'));
 }
 public function searchBy($term)
 {
     $elements = $this->elementRepository->search($term);
     header("Access-Control-Allow-Origin:" . $this->clientURL);
     return $this->sendResponse($elements, "Elements retrieved successfully");
 }
 /**
  * undocumented function
  *
  * @return void
  * @author 
  **/
 public function createInside($id)
 {
     $container = $this->elementRepository->find($id);
     return view('files.create-here')->with('container', $container);
 }