app/maguttiCms/Website/Controllers/Auth/RegisterController.php
/**
     * Handle a registration request for the application.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Handle a registration request for the application.
Handle a registration request for the application .
public function register(Request $request)
    {
        $this->validator($request->all())->validate();
        if ($request->redirectTo) {
            if(in_array($request->redirectTo, config('maguttiCms.security.redirectTo')) == true) {
               $this->redirectTo = $request->redirectTo;
            }
        }
        event(new Registered($user = $this->create($request->all())));
        $this->guard()->login($user);
		if (StoreFeatures::isStoreEnabled()) {
			$cart = StoreHelper::getSessionCart();
			if ($cart) {
				$cart->user()->associate($user);
				$cart->save();
				StoreHelper::setSessionCart($cart);
			}
		}
        return $this->registered($request, $user)
                        ?: redirect($this->redirectPath());
    }
public function register ( Request $ request ) { $ this -> validator ( $ request -> all ( ) ) -> validate ( ) ; if ( $ request -> redirectTo ) { if ( in_array ( $ request -> redirectTo , config ( 'maguttiCms.security.redirectTo' ) ) == true ) { $ this -> redirectTo = $ request -> redirectTo ; } } event ( new Registered ( $ user = $ this -> create ( $ request -> all ( ) ) ) ) ; $ this -> guard ( ) -> login ( $ user ) ; if ( StoreFeatures :: isStoreEnabled ( ) ) { $ cart = StoreHelper :: getSessionCart ( ) ; if ( $ cart ) { $ cart -> user ( ) -> associate ( $ user ) ; $ cart -> save ( ) ; StoreHelper :: setSessionCart ( $ cart ) ; } } return $ this -> registered ( $ request , $ user ) ? : redirect ( $ this -> redirectPath ( ) ) ; }
Handle a registration request for the application.
Handle a registration request for the application .
// If the redirect to path is in white list. // if the guet has an active cart, set it to his new user