Example #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     if (Auth::check()) {
         # code...
         if (Auth::user()->type == 1) {
             # code...
             //$event=Event::findOrFail($id);
             $events = Event::findOrFail($id);
             $image_path = $events->image_path;
             \File::delete($image_path);
             $event = Event::destroy($id);
             Session::flash('eventDeleted', 'The event has been deleted');
             return redirect('event');
         }
         return redirect('/');
     }
     return redirect('/');
 }
Example #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Event::destroy($id);
     return;
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Request $request)
 {
     foreach ($request->input('to_delete') as $item_id) {
         // delete file if exists
         $image = Event::getImage($item_id);
         $this->deleteImage('events', $image);
         Event::destroy($item_id);
         // delete all rels
         if (Category_to_Event::countCategoriesByEventID($item_id) > 0) {
             Category_to_Event::deleteAllRelByEventId($item_id);
         }
         if (People_to_Rols::countCastingByEventID($item_id) > 0) {
             People_to_Rols::deleteAllRelByEventId($item_id);
         }
         if (EventDate::countDatesByEventID($item_id) > 0) {
             EventDate::deleteAllByEventID($item_id);
         }
     }
     Session::flash('message', 'Evento borrado Correctamente');
     return Redirect::to('events');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function getDelete($id)
 {
     //
     Event::destroy($id);
     return redirect()->back();
 }
Example #5
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Event::destroy($id);
     Session::flash('message', 'event eliminado correctamente');
     return Redirect::to('event');
 }
Example #6
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Event::destroy($id);
     return response(null, Response::HTTP_NO_CONTENT);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $event = Event::findOrFail($id);
     if (Gate::allows('manage', $event)) {
         Event::destroy($id);
         return redirect('events');
     } else {
         return abort(403);
     }
 }
Example #8
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Event::destroy($id);
 }
Example #9
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  Request  $request
  * @return \Illuminate\Http\Response
  */
 public function multiple_delete(Request $request)
 {
     Event::destroy($request->ids);
     $response = ['model_type' => 'Event', 'ids' => $request->ids, 'action_type' => 'delete'];
     return json_encode($response);
 }
Example #10
0
 /**
  * Delete an existing event from the events table.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function deleteEvent($id)
 {
     Event::destroy($id);
     return redirect('/admin');
 }
Example #11
0
 /**
  * @param  int 		$encryptedPartnerId	The encrypted value of the Partner ID to be destroyed
  * @return Redirect 	Back to the previous page
  */
 public function destroy($encryptedEventID)
 {
     if (!Auth::check() || !Auth::user()->is_admin) {
         return response(view('errors.403', ['error' => $this->errorMessages['incorrect_permissions']]), 403);
     }
     $eventID = Crypt::decrypt($encryptedEventID);
     DB::delete('delete from media where event_id = ?', [$eventID]);
     DB::delete('delete from tickets where event_id = ?', [$eventID]);
     Event::destroy($eventID);
     return Redirect::back();
 }