diff --git a/src/Connect.php b/src/Connect.php index 59ebc39..7e8a680 100644 --- a/src/Connect.php +++ b/src/Connect.php @@ -60,10 +60,10 @@ class Connect ]; if ($auth === true) { - $config['Authorization'] = 'Bearer ' . $this->getAccessToken(); + $config['headers']['Authorization'] = 'Bearer ' . $this->getAccessToken(); } elseif ($auth !== false) { - $config['Authorization'] = 'Bearer ' . $auth; + $config['headers']['Authorization'] = 'Bearer ' . $auth; } if (!is_null($data)) { diff --git a/src/Traits/HasConnectSync.php b/src/Traits/HasConnectSync.php index 879a812..cab6011 100644 --- a/src/Traits/HasConnectSync.php +++ b/src/Traits/HasConnectSync.php @@ -14,6 +14,7 @@ trait HasConnectSync { $record = new self; $record->fill($data); + $record->id = $id; $record->save(); return true; } @@ -22,6 +23,7 @@ trait HasConnectSync { $record = self::find($id) ?? new self; $record->fill($data); + $record->id = $id; $record->save(); return true; }