Hey,
I was wondering if there's a built in way or an easy method to let admin register a new account without logging out from his account. Meaning that he would be able to give his phone for example to a new user, and let him fill in the details, click on Register and then get back to his panel without logging out from the new user, and then logging back in to the admin account.
Of course that is possible, but you're not going to find that functionality out-of-the-box.
It should be pretty simple though.. just create a form that is only accessible by admins, and then bind the user account model. No need to logout/login.. Just have a dedicated controller that persists the new account and then redirects back to the admin panel.
Perhaps finding a simple table-editor package would do the trick, too.
public function register(Request $request)
{
$this->validator($request->all())->validate();
event(new Registered($user = $this->create($request->all())));
$this->guard()->login($user);
return $this->registered($request, $user)
?: redirect($this->redirectPath());
}
1- validate inputs,
2- create a user and fire event
3- login as registered user
4- return to previous visited url.
You can modify this function to what you want. I think step 1 and 2 is all you want. Just validate inputs and create user then fire Registered event.
@dabnad the easy and simple way is to create a UsersController with views for users' CRUD and restrict its access to admin, so the admin could add, delete or update users.