當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。