mercredi 7 février 2018

Allow registered user to register new users and disable auto-login after registration

I have created an admin panel for my application. Also implemented auth system. But laravel's standard auth system doesn't allow registered users create new ones and always redirect to /home route. I have overrided the register(Request $request) method in order to disable auto-login, but I still have a trouble with the registration. How can I implement such a functionality? What's the workaround?

Here's the overrided register(Request $request) method in RegisterController:

public function register(Request $request)
{
    $this->validator($request->all())->validate();

    event(new Registered($user = $this->create($request->all())));

    return redirect()->route('users');
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire