/** * @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'); }
/** * 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])); }
/** * 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')); }
/** * @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'); }
/** * 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'); }
/** * @param $id */ public function destroy($id) { $this->user->delete($id); Flash::success('User successfully deleted'); return redirect('/users'); }