當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Event::destroy方法代碼示例

本文整理匯總了PHP中app\Event::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Event::destroy方法的具體用法?PHP Event::destroy怎麽用?PHP Event::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Event的用法示例。


在下文中一共展示了Event::destroy方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: destroy

 /**
  * 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('/');
 }
開發者ID:a-madhukar,項目名稱:Yahya,代碼行數:25,代碼來源:EventController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Event::destroy($id);
     return;
 }
開發者ID:jentleyow,項目名稱:pcf,代碼行數:11,代碼來源:EventsController.php

示例3: destroy

 /**
  * 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');
 }
開發者ID:lautaruni,項目名稱:billboard,代碼行數:27,代碼來源:DispatchController.php

示例4: getDelete

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function getDelete($id)
 {
     //
     Event::destroy($id);
     return redirect()->back();
 }
開發者ID:palhimanshu1991,項目名稱:dastangoi,代碼行數:12,代碼來源:EventController.php

示例5: destroy

 /**
  * 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');
 }
開發者ID:jona872,項目名稱:planear5,代碼行數:12,代碼來源:EventController.php

示例6: destroy

 /**
  * 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);
 }
開發者ID:rit-sse,項目名稱:api,代碼行數:11,代碼來源:EventController.php

示例7: destroy

 /**
  * 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);
     }
 }
開發者ID:partio-scout,項目名稱:kokous_backend,代碼行數:16,代碼來源:EventController.php

示例8: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Event::destroy($id);
 }
開發者ID:julesnicolas,項目名稱:student,代碼行數:10,代碼來源:EventController.php

示例9: multiple_delete

 /**
  * 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);
 }
開發者ID:poudigne,項目名稱:lcdj,代碼行數:12,代碼來源:EventController.php

示例10: deleteEvent

 /**
  * 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');
 }
開發者ID:xRokco,項目名稱:websysproject,代碼行數:11,代碼來源:AdminController.php

示例11: destroy

 /**
  * @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();
 }
開發者ID:TheJokersThief,項目名稱:Eve,代碼行數:15,代碼來源:EventsController.php


注:本文中的app\Event::destroy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。