public function doFeatured($event, $id, $data = null) { // $data = null; $api = new \App\Helpers\ApiHelper(); $url = 'events/' . $event . '/photos/' . $id; if (\Auth::check()) { $url .= '?auth_user_id=' . \Auth::user()->id; } $featured = $api->update($url, '', $data); return \Redirect::back(); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function doEdit($id) { // Request the edit data $data = \Request::all(); $eventId = $data['eventId']; Input::flash(); // Instantiate api helper $api = new \App\Helpers\ApiHelper(); // Submit the data to update $ticket = $api->update('ticketsinventories', $id, $data); // Json encode the returned data $data = json_encode(['enabled' => (bool) $data]); // If success is returned true show the success message, if not, redirect back with errors if (!isset($ticket['success'])) { return \Redirect::back()->with('fail_message', 'Ticket has errors')->with('name', isset($ticket['error']['name'][0]) ? $ticket['error']['name'][0] : null)->with('amount', isset($ticket['error']['amount'][0]) ? $ticket['error']['amount'][0] : null)->with('inventory', isset($ticket['error']['inventory'][0]) ? $ticket['error']['inventory'][0] : null)->withInput(); } // Redirect message will show based on if saved item is ticket or reservation if ($ticket['data']['inventory']['is_reservation'] === true) { // Encodes message to get sent with url $message = urlencode('Please wait while your reservation is being updated'); } else { // Encodes message to get sent with url $message = urlencode('Please wait while your ticket is being updated'); } // return Route::get('pages.loader', 302)->header('Location', (string)$url); $url = "time=4000&url=/account/tickets/index/" . $eventId . "&message=" . $message; return Redirect::to(route('pages.loader', (string) $url)); }
public function editTables($id) { $data = \Request::all(); $api = new \App\Helpers\ApiHelper(); $events = $api->update('events', $id, $data); $events = $events['data']['event']; return View::make('accounts.dashboard.tickets.edit.edit')->with(['events' => $events]); }