I am trying to override the registration function in Laravel 5 following the suggestion in this question. In my case, however, I am not trying to redirect users from the registration page. Rather, I would just like to register a new user, but keep the current user (administrator) logged in. The function checks by default, then logs in a new user and then redirects to "home". So here is what I tried to add to AuthController.php:
public function postRegister(Request $request) {
$validator = $this->registrar->validator($request->all());
if ($validator->fails())
{
$this->throwValidationException(
$request, $validator
);
}
$this->registrar->create($request->all());
return redirect('admin');
}
, , . . !