The redirect_uri_mismatch error usually occurs when the redirect URI that you provided in your Google API Console does not match the redirect URI that you specified in your code.
To fix this error, you need to make sure that the redirect URI in your code exactly matches the authorized redirect URI that you specified in the Google API Console for your project.
In your case, it looks like you've set the authorized redirect URI in the Google API Console to https://www.google.com. However, in your code, you're setting the redirect URI to url('https://www.google.com'). This might be causing the mismatch error.
To fix this, you can try setting the redirect URI in your code to https://www.google.com directly, like this:
$client->setRedirectUri('https://www.google.com');
Alternatively, you can try adding the full redirect URI (including the https://) to the authorized redirect URIs in the Google API Console, like this:
Make sure to save your changes in the Google API Console and test your code again to see if the error has been resolved.
I hope this helps you fix the redirect_uri_mismatch error! Let me know if you have any questions or need further assistance.