all(); $input['password'] = Hash::make($input['password']); $user = User::create($input); return redirect()->route('users.index')->withMessage(trans('quickadmin::admin.users-controller-successfully_created')); } /** * Show a user edit page * * @param $id * * @return \Illuminate\View\View */ public function edit($id) { $user = User::findOrFail($id); $roles = Role::pluck('title', 'id'); return view('admin.users.edit', compact('user', 'roles')); } /** * Update our user information * * @param Request $request * @param $id * * @return \Illuminate\Http\RedirectResponse */ public function update(Request $request, $id) { $user = User::findOrFail($id); $input = $request->all(); if ($request->input('password') != '') { $input['password'] = Hash::make($input['password']); } else { unset($input['password']); } $user->update($input); return redirect()->route('users.index')->withMessage(trans('quickadmin::admin.users-controller-successfully_updated')); } /** * Destroy specific user * * @param $id * * @return \Illuminate\Http\RedirectResponse */ public function destroy($id) { $user = User::findOrFail($id); User::destroy($id); return redirect()->route('users.index')->withMessage(trans('quickadmin::admin.users-controller-successfully_deleted')); } }