本文整理汇总了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('/');
}
示例2: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Event::destroy($id);
return;
}
示例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');
}
示例4: getDelete
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function getDelete($id)
{
//
Event::destroy($id);
return redirect()->back();
}
示例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');
}
示例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);
}
示例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);
}
}
示例8: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Event::destroy($id);
}
示例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);
}
示例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');
}
示例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();
}