/** * Deletes selected event * * @param $id Event id * * @return bool Will determine if published or unpublished event */ public function doEventDelete($id) { // Instantiate the APIHelper $api = new \App\Helpers\ApiHelper(); $url = 'events/' . $id; if (\Auth::check()) { $url .= '?auth_user_id=' . \Auth::user()->id; } // Show event associated the ID. $event = $api->destroy($url, ''); if ($event['success'] === true) { return \Redirect::route('dashboard')->with('success_message', 'Event succesfully deleted.'); } else { return Redirect::back()->with('error', 'Error, Could not find resource.'); } }
/** * TODO: update DOC * @return [type] Deletes wall comments */ public function doDeleteWallComments($id) { // Instanciate the APIHelper $api = new \App\Helpers\ApiHelper(); // Deletes wall comment from database $response = $api->destroy('usersupdates', $id); // Redirect back to the events page and comment section if ($response) { return Redirect::to(\URL::previous() . "#wallcomments"); } }