Coder Social home page Coder Social logo

blog-google-calendar's Issues

Integrity constraint violation: 1048 Column 'name' cannot be null

If the google event name ($googleEvent->summary) is empty it causes an exception and the sync fails. I added a turnery, maybe there is a better option, but this works for me.

SynchronizeGoogleEvents.php

'name' => $googleEvent->summary ? $googleEvent->summary : 'Event',

Call to a member function synchronize() on null

Hi, Thank you for your awesome work.
I am having an issue with Part 2 of your tutorial/files
Call to a member function synchronize() on null {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function synchronize() on null at /var/www/xxxxxxxx/app/Synchronization.php:22)

Google Plus no longer available

Has anyone got this working since Jan 15, 2020, if yes what did you use in replacement of Google Plus?
class GoogleAccountController ---- around line 44 $account = $google->service('Plus')->people->get('me');
throws a Legacy error.

Thanks in advance!

reset() expects parameter 1 to be array, string given

Issue appear on this line:
'name' => head($account->email)->value,

public function store(Request $request, Google $google)
{
if (! $request->has('code')) {
return redirect($google->createAuthUrl());
}

	// Use the given code to authenticate the user.
	$google->authenticate($request->get('code'));

	// Make a call to the Google+ API to get more information on the account.
	$account = $google->service('Oauth2')->userinfo->get();

	auth()->user()->googleAccounts()->updateOrCreate(
		[
			// Map the account's id to the `google_id`.
			'google_id' => $account->id,
		],
		[
			// Use the first email address as the Google account's name.
			'name' => head($account->email)->value,

			// Last but not least, save the access token for later use.
			'token' => $google->getAccessToken(),
		]
	);

	return redirect()->route('google.index');
}

Suggestion: Turn this into a package

I think this project is very well made and I was going to use it in the current product I am working on but... I am strongly against cannibalizing people's code.

I would like to suggest that you refactor this into a package so other people can extend it properly at same time that the credits for your work are preserved.

Thanks and congrats again on this tutorial.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.