예제 #1
0
 public function deleteUserDocument($file_id)
 {
     try {
         if (UserDocument::destroy($file_id)) {
             return true;
         }
         return false;
     } catch (Exception $e) {
         return Response::json(['error' => $e->getMessage()]);
     }
 }
예제 #2
0
 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()]);
     }
 }