You've already forked laravel-connect
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b3a698daa | |||
| 3b79a880ae | |||
| 14b47b6f6e | |||
| eda52c3d65 |
@@ -7,9 +7,6 @@ The Bluesquare Connect package allows you to use its OAuth server and sync its r
|
|||||||
Update your `composer.json`:
|
Update your `composer.json`:
|
||||||
|
|
||||||
```
|
```
|
||||||
"require": {
|
|
||||||
"bluesquare/laravel-connect": "dev-master"
|
|
||||||
}
|
|
||||||
"repositories": [
|
"repositories": [
|
||||||
{
|
{
|
||||||
"type": "vcs",
|
"type": "vcs",
|
||||||
@@ -21,7 +18,7 @@ Update your `composer.json`:
|
|||||||
Install the package:
|
Install the package:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
composer update bluesquare/laravel-connect
|
composer require bluesquare/laravel-connect "1.2"
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, update your `.env` with your client's credentials:
|
Finally, update your `.env` with your client's credentials:
|
||||||
|
|||||||
@@ -35,8 +35,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"guzzlehttp/guzzle": "^7.2",
|
"guzzlehttp/guzzle": "^7.3",
|
||||||
"php": "^7.2"
|
"php": "^7.3|^8.0"
|
||||||
},
|
},
|
||||||
"prefer-stable": true
|
"prefer-stable": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ return [
|
|||||||
/**
|
/**
|
||||||
* OAuth model
|
* OAuth model
|
||||||
*/
|
*/
|
||||||
'model' => \App\User::class,
|
'model' => \App\Models\User::class,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Route that redirects to Bluesquare Connect
|
* Route that redirects to Bluesquare Connect
|
||||||
|
|||||||
@@ -20,7 +20,13 @@ trait HasConnectSync
|
|||||||
public static function onConnectResourceCreated($id, $data)
|
public static function onConnectResourceCreated($id, $data)
|
||||||
{
|
{
|
||||||
$record = self::findConnectResource($id) ?? new self;
|
$record = self::findConnectResource($id) ?? new self;
|
||||||
$record->fill($data); // TODO
|
$attributes = $record->getConnectFillableAttributes();
|
||||||
|
|
||||||
|
foreach ($data as $key => $value) {
|
||||||
|
if (in_array($key, $attributes))
|
||||||
|
$record->$key = $value;
|
||||||
|
}
|
||||||
|
|
||||||
$record->{self::$connectColumnId} = $id;
|
$record->{self::$connectColumnId} = $id;
|
||||||
return $record->save();
|
return $record->save();
|
||||||
}
|
}
|
||||||
@@ -40,4 +46,9 @@ trait HasConnectSync
|
|||||||
{
|
{
|
||||||
return $record->forceDelete();
|
return $record->forceDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getConnectFillableAttributes()
|
||||||
|
{
|
||||||
|
return $this->fillable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user