当前位置: 首页>>代码示例>>PHP>>正文


PHP Department::delete方法代码示例

本文整理汇总了PHP中app\Department::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::delete方法的具体用法?PHP Department::delete怎么用?PHP Department::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Department的用法示例。


在下文中一共展示了Department::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: destroy

 public function destroy(Department $department)
 {
     if (!Helper::getMode()) {
         return redirect()->back()->withErrors(config('constants.DISABLE_MESSAGE'));
     }
     $department->delete();
     return redirect('/configuration#department')->withSuccess(config('constants.DELETED'));
 }
开发者ID:EneaWeb,项目名称:aliangel,代码行数:8,代码来源:DepartmentController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Department $department)
 {
     if ($department->id < 7) {
         return redirect()->route('admin.department.index')->with('danger', 'You\'d not better do this action!!!');
     }
     $department->delete();
     return redirect()->route('admin.department.index')->with('success', 'successfully deleted');
 }
开发者ID:trongtri0705,项目名称:elinext_project,代码行数:14,代码来源:DepartmentController.php

示例3: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  Department  $department
  * @return \Illuminate\Http\Response
  */
 public function destroy(Department $department)
 {
     try {
         $department->delete();
     } catch (QueryException $e) {
         return redirect()->back()->with('error', 'error-delete-department');
     }
     File::delete('images/' . $department->image);
     File::delete('papers/' . $department->keyword);
     Cache::forget('departments');
     return redirect(action('Admin\\DepartmentController@index'))->with('success', 'deleted');
 }
开发者ID:Tisho84,项目名称:conference,代码行数:18,代码来源:DepartmentController.php

示例4: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(Department $department)
 {
     if (!$department) {
         abort(403, "Department does not exist, permanently deleted");
     }
     if (!Auth::user()->can('administrate-department')) {
         abort(401, "You do not have permission to delete this department");
     }
     $department->delete();
     return $department;
 }
开发者ID:dwoodard,项目名称:IserveU,代码行数:17,代码来源:DepartmentController.php

示例5: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Department $department)
 {
     $department->delete();
     return redirect()->route('admin.department.index')->with('success', 'successfully deleted');
 }
开发者ID:trongtri0705,项目名称:staff,代码行数:11,代码来源:DepartmentController.php


注:本文中的app\Department::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。