/**
  * Remove the specified Role from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $role = $this->roleRepository->find($id);
     if (empty($role)) {
         $this->throwRecordNotFoundException("Role not found", ERROR_CODE_RECORD_NOT_FOUND);
     }
     $role = $this->roleRepository->delete($id);
     $meta = array('total' => count($role), 'count' => count($role), 'offset' => 0, 'last_updated' => $this->roleRepository->lastUpdated(), 'status' => "Role deleted successfully.", 'error' => 'Success');
     return Response::json(ResponseManager::makeResult($id, $meta));
 }
Example #2
0
 /**
  * Remove the specified Role from storage.
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     $role = $this->roleRepository->find($id);
     if (empty($role)) {
         Flash::error('Role not found');
         return redirect(route('roles.index'));
     }
     $this->roleRepository->delete($id);
     Flash::success('Role deleted successfully.');
     return redirect(route('roles.index'));
 }
 /**
  * Remove the specified Role from storage.
  * DELETE /roles/{id}
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $this->roleRepository->apiDeleteOrFail($id);
     return $this->sendResponse($id, "Role deleted successfully");
 }