public function deleteUserDocument($file_id) { try { if (UserDocument::destroy($file_id)) { return true; } return false; } catch (Exception $e) { return Response::json(['error' => $e->getMessage()]); } }
public function getUserDocuments($user_id) { try { return UserDocument::where('user_id', '=', $user_id)->with('file')->get()->toArray(); } catch (Exception $e) { return Response::json(['error' => $e->getMessage()]); } }