当前位置: 首页>>代码示例>>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;未经允许,请勿转载。