public function handle(RegistrationRequest $request)
    {
        DB::beginTransaction();

        // Try to register the user.
        try {
            $user = $this->registration->registerUser();
        } catch (\Exception $exception) {
            DB::rollBack();

            logger()->error($exception);

            return redirect(route('auth.register'))
                ->with('errors', $exception->getMessage());
        }

        DB::commit();

        // If the app requires activation, generate a token and email them.
        if (config('jumpgate.users.require_email_activation')) {
            return redirect(route('auth.activation.generate', $user->id));
        }

        // Log the user in.
        auth()->login($user);

        return redirect(route('home'))
            ->with('message', 'Your account has been created.');
    }
public function handle(RegistrationRequest $request)
    {
        DB::beginTransaction();

        // Try to register the user.
        try {
            $user = $this->registration->registerUser();
        } catch (\Exception $exception) {
            DB::rollBack();

            logger()->error($exception);

            return redirect(route('auth.register'))
                ->with('errors', $exception->getMessage());
        }

        DB::commit();

        // If the app requires activation, generate a token and email them.
        if (config('jumpgate.users.require_email_activation')) {
            return redirect(route('auth.activation.generate', $user->id));
        }

        // Log the user in.
        auth()->login($user);

        return redirect(route('home'))
            ->with('message', 'Your account has been created.');
    }
public function handle ( RegistrationRequest $ request ) { DB :: beginTransaction ( ) ; // Try to register the user.
 try { $ user = $ this -> registration -> registerUser ( ) ; } catch ( \ Exception $ exception ) { DB :: rollBack ( ) ; logger ( ) -> error ( $ exception ) ; return redirect ( route ( 'auth.register' ) ) -> with ( 'errors' , $ exception -> getMessage ( ) ) ; } DB :: commit ( ) ; // If the app requires activation, generate a token and email them.
 if ( config ( 'jumpgate.users.require_email_activation' ) ) { return redirect ( route ( 'auth.activation.generate' , $ user -> id ) ) ; } // Log the user in.
 auth ( ) -> login ( $ user ) ; return redirect ( route ( 'home' ) ) -> with ( 'message' , 'Your account has been created.' ) ; }
Handle validating the registration.

@param \JumpGate\Users\Http\Requests\Registration $request

@return \Illuminate\Http\RedirectResponse
Handle validating the registration .