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


PHP UserRepository::delete方法代码示例

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


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

示例1: destroy

 /**
  * @param $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function destroy($id)
 {
     $user = $this->user->find($id);
     $this->user->delete($id);
     Flash::success(trans('admin/users/general.status.deleted'));
     return redirect('/admin/users');
 }
开发者ID:hramose,项目名称:laravel5.1,代码行数:11,代码来源:UsersController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $user = $this->userRepository->findById($id);
     $eventDescription = trans('back.events.deleted', ['model' => 'Gebruiker', 'name' => $user->email]);
     Activity::log($eventDescription);
     flash()->success(strip_tags($eventDescription));
     $this->userRepository->delete($user);
     return redirect(URL::action('Back\\UserController@index', ['role' => $user->role]));
 }
开发者ID:bjrnblm,项目名称:blender,代码行数:16,代码来源:UserController.php

示例3: destroy

 /**
  * Remove the specified User from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $user = $this->userRepository->findWithoutFail($id);
     if (empty($user)) {
         Flash::error('User not found');
         return redirect(route('users.index'));
     }
     $this->userRepository->delete($id);
     Flash::success('User deleted successfully.');
     return redirect(route('users.index'));
 }
开发者ID:sagaciresearch,项目名称:adtracking,代码行数:18,代码来源:UserController.php

示例4: destroy

 /**
  * @param $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function destroy($id)
 {
     $user = $this->user->find($id);
     if (!$user->isdeletable()) {
         abort(403);
     }
     Audit::log(Auth::user()->id, trans('admin/users/general.audit-log.category'), trans('admin/users/general.audit-log.msg-destroy', ['username' => $user->username]));
     $this->user->delete($id);
     Flash::success(trans('admin/users/general.status.deleted'));
     return redirect('/admin/users');
 }
开发者ID:koanreview,项目名称:laravel-5.1-enterprise-starter-kit,代码行数:15,代码来源:UsersController.php

示例5: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroy($id)
 {
     $this->users->delete($id);
     return redirect()->route('admin.users.index');
 }
开发者ID:pet1330,项目名称:tyloo,代码行数:12,代码来源:UsersController.php

示例6: destroy

 /**
  * @param $id
  */
 public function destroy($id)
 {
     $this->user->delete($id);
     Flash::success('User successfully deleted');
     return redirect('/users');
 }
开发者ID:ampodobas,项目名称:uci-law-sba-outline-bank,代码行数:9,代码来源:UsersController.php


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