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


PHP User::delete方法代码示例

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


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

示例1: destroyUser

 public function destroyUser(User $user, Request $request)
 {
     $name = $user->fullname();
     $user->delete();
     Flash::danger("<strong>{$name}</strong> wurde gelöscht.");
     return redirect()->back();
 }
开发者ID:patrikkernke,项目名称:basecamp,代码行数:7,代码来源:TeamController.php

示例2: destroy

 public function destroy(User $user)
 {
     $name = $user->name;
     $user->delete();
     session()->flash('message', $name . "同学已经被移除");
     return Redirect::back();
 }
开发者ID:rossli,项目名称:StuGradeWithLaravel5,代码行数:7,代码来源:AdminController.php

示例3: delete_user_role

 private function delete_user_role(User $user, Role $role)
 {
     //Remove all permissions then delete the user and the roles
     $role->perms()->sync(array());
     $user->delete();
     $role->delete();
 }
开发者ID:brucewu16899,项目名称:WebPanel-Core,代码行数:7,代码来源:PermissionsTest.php

示例4: destroy

 public function destroy(User $user)
 {
     if ($user == auth()->user()) {
         return "Feriştahın gelse silemez beni!";
     }
     $user->delete();
     return redirect()->route('admin.user.index')->with("success", trans("realestateadmin::user.deleted"));
 }
开发者ID:labkod,项目名称:real-estate,代码行数:8,代码来源:UserController.php

示例5: destroy

 public function destroy(User $user)
 {
     $name = $user->name;
     $user->delete();
     session()->flash('message', $name . "人员已经被移除");
     EventController::SaveEvent('users', 'destroy(删除)');
     return Redirect::back();
 }
开发者ID:purplebleed,项目名称:hljtnbdm,代码行数:8,代码来源:AdminController.php

示例6: destroy

 public function destroy(User $user)
 {
     try {
         $user->delete();
         return response()->json(['errors' => 'false', 'message' => 'The project has been deleted!']);
     } catch (\Exception $e) {
         return response()->json(['errors' => 'true', 'message' => 'Something went wrong!']);
     }
 }
开发者ID:jasonraimondi,项目名称:twitterclone,代码行数:9,代码来源:UserController.php

示例7: destroy

 public function destroy(User $user)
 {
     if (Storage::disk('profile')->exists($user->photo) && Storage::disk('cover')->exists($user->cover)) {
         Storage::disk('profile')->delete($user->photo);
         Storage::disk('cover')->delete($user->cover);
     }
     $user->delete();
     return redirect()->route('admin.user.index')->with('success', 'کاربر با موفقیت حذف شد.');
 }
开发者ID:majid-n,项目名称:cometdev,代码行数:9,代码来源:UserController.php

示例8: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(User $user)
 {
     var_dump($user->id);
     var_dump(Auth::user()->id);
     if (Auth::user()->id != $user->id) {
         $user->delete();
         return Redirect::route('users.index')->with('message', 'User deleted');
     }
     return Redirect::route('users.index')->with('message', 'You cannot delete the user that you are currently logged in as');
 }
开发者ID:redcatthethird,项目名称:garage-manager,代码行数:16,代码来源:UserController.php

示例9: deleteUser

 /**
  * Delete a user
  */
 public function deleteUser(Request $request, User $user)
 {
     if (auth()->user()->id == $user->id) {
         flash()->error('You can not delete yourself', 'Have some self respect.');
         return redirect()->back();
     }
     logThis('User ' . $user->name . ' was deleted by ' . auth()->user()->name);
     flash()->success('Success!', 'User ' . $user->name . ' was deleted.');
     $user->delete();
     return redirect()->back();
 }
开发者ID:goatatwork,项目名称:goldaccess-support,代码行数:14,代码来源:AdminController.php

示例10: destroy

 /**
  * Remove the specified user from storage.
  *
  * @param User $user
  * @return Response
  */
 public function destroy(User $user)
 {
     if ($user->id != Auth::user()->id) {
         $user->delete() ? Flash::success(trans('admin.delete.success')) : Flash::error(trans('admin.delete.fail'));
     } else {
         Flash::error(trans('admin.delete.self'));
     }
     return redirect(route('admin.user.index'));
 }
开发者ID:amanullah-1,项目名称:laravel-5-simple-cms,代码行数:15,代码来源:UserController.php

示例11: destroy

 public function destroy(User $user)
 {
     $user->delete();
     return redirect('/');
 }
开发者ID:michaelkimball,项目名称:MigraineTracker,代码行数:5,代码来源:UserController.php

示例12: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request, User $user)
 {
     $user->delete();
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($user);
     }
     return redirect('users');
 }
开发者ID:vergidul,项目名称:personal_project,代码行数:14,代码来源:UsersController.php

示例13: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(User $user)
 {
     if (!$user->remove) {
         \Flash::error('Default user cannot be removed.');
         return redirect()->route('admin.users.index');
     } else {
         $user->delete();
         \Flash::success('User has been Deleted');
         return redirect()->route('admin.users.index');
     }
 }
开发者ID:maherelgamil,项目名称:ketabat,代码行数:17,代码来源:UsersController.php

示例14: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param $user
  * @return Response
  */
 public function destroy(User $user)
 {
     $user->delete();
 }
开发者ID:coralhust,项目名称:Laravel-5-Bootstrap-3-Starter-Site,代码行数:10,代码来源:UserController.php

示例15: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Request $request, City $city, User $user)
 {
     $user_events = Event::where('user_id', '=', $user->id)->delete();
     $user->delete();
     return Redirect::route('{city}.users.index', $city->iata)->with('message', 'User removed');
 }
开发者ID:EMT,项目名称:see-do,代码行数:12,代码来源:UsersController.php


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