~~~ GOOGLE_ID=81988704422-d5ribl0oj2ac6clnjjg7g2ncefg68q49.apps.googleusercontent.com GOOGLE_SECRET=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 CALL_BACK_URI=/api/login/googleCallBack public function googleGetCode(Request $request): Response { $client_id = getenv('GOOGLE_ID'); $uri=urlencode(getenv('DOMAIN').getenv('CALL_BACK_URI')); $scope=urlencode('https://www.googleapis.com/auth/userinfo.profile'); $url = "https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=offline&client_id={$client_id}&redirect_uri={$uri}&state=state_parameter_passthrough_value&scope={$scope}&approval_prompt=auto"; return successMsgTrans([ 'url' => $url ]); } public function googleCallBack(Request $request) { $code = $request->input("code") ?? null; var_dump($code); return json([]); } ~~~