コード例 #1
0
ファイル: UserController.php プロジェクト: bjrnblm/blender
 /**
  * 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]));
 }
コード例 #2
0
 /**
  * Show the form for editing the specified user.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $user = $this->userRepository->findById($id);
     return View('admin.users.edit')->with(compact('user'));
 }
コード例 #3
0
 public function destroy($id)
 {
     $this->userRepository->findById($id)->delete();
     app()->make('flash')->info('User deleted');
     return redirect()->back();
 }
コード例 #4
0
 /**
  * Finds a throttler by the given user ID.
  *
  * @param mixed $id
  * @param string $ipAddress
  *
  * @return \App\Contracts\Throttle\ThrottleInterface
  */
 public function findByUserId($id, $ipAddress = null)
 {
     return $this->findByUser($this->userProvider->findById($id), $ipAddress);
 }