/** * 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])); }
/** * 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')); }
public function destroy($id) { $this->userRepository->findById($id)->delete(); app()->make('flash')->info('User deleted'); return redirect()->back(); }
/** * 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); }