Skip to content

Commit

Permalink
Merge 821f4e2 into c198eee
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Nov 26, 2016
2 parents c198eee + 821f4e2 commit 0707732
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions config/laravel-google-calendar.php
Expand Up @@ -2,14 +2,14 @@

return [

/**
/*
* Path to a json file containing the credentials of a Google Service account.
*/
'client_secret_json' => storage_path('app/laravel-google-calendar/client_secret.json'),

/**
/*
* The id of the Google Calendar that will be used by default.
*/
'calendar_id' => '',

];
15 changes: 7 additions & 8 deletions src/Event.php
Expand Up @@ -140,9 +140,8 @@ public static function find($eventId, $calendarId = null): Event
public function save($forceCreate = false): Event
{
$method = $this->exists() ? 'updateEvent' : 'insertEvent';

if($forceCreate)
{

if ($forceCreate) {
$method = 'insertEvent';
}

Expand Down Expand Up @@ -203,12 +202,12 @@ protected function setDateProperty(string $name, Carbon $date)
protected function getFieldName(string $name): string
{
return [
'name' => 'summary',
'description' => 'description',
'startDate' => 'start.date',
'endDate' => 'end.date',
'name' => 'summary',
'description' => 'description',
'startDate' => 'start.date',
'endDate' => 'end.date',
'startDateTime' => 'start.dateTime',
'endDateTime' => 'end.dateTime',
'endDateTime' => 'end.dateTime',
][$name] ?? $name;
}

Expand Down
1 change: 0 additions & 1 deletion src/GoogleCalendarServiceProvider.php
Expand Up @@ -24,7 +24,6 @@ public function register()
$this->mergeConfigFrom(__DIR__.'/../config/laravel-google-calendar.php', 'laravel-google-calendar');

$this->app->bind(GoogleCalendar::class, function () {

$calendarId = config('laravel-google-calendar.calendar_id');

return GoogleCalendarFactory::createForCalendarId($calendarId);
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/EventTest.php
Expand Up @@ -5,8 +5,8 @@
use Carbon\Carbon;
use DateTime;
use Mockery;
use Spatie\GoogleCalendar\Test\Integration\TestCase;
use Spatie\GoogleCalendar\Event;
use Spatie\GoogleCalendar\Test\Integration\TestCase;

class EventTest extends TestCase
{
Expand Down

0 comments on commit 0707732

Please sign in to comment.