Skip to content

Commit

Permalink
Updated laravel and event syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenMarkToms committed Jul 7, 2022
1 parent f3fa687 commit 54e3da5
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/Models/BlockType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use GeneaLabs\LaravelPivotEvents\Traits\PivotEventTrait;

class BlockType extends Model
{
use PivotEventTrait;

protected $fillable = [
'name',
'file_name',
Expand Down
5 changes: 5 additions & 0 deletions app/Observers/BlockTypeObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public function ReplaceFile(String $repoUrl, array $data, String $oldFileName, S
$this->CreateFile($data, $url, $token);
}

public function pivotSynced(BlockType $blockType)
{
dd(($blockType->getOriginal()));
}

/**
* Handle the BlockType "updated" event.
*
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"php": "^7.3|^8.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"genealabs/laravel-pivot-events": "*",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^9.0",
"laravel/sanctum": "^2.11",
Expand Down
59 changes: 57 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 54e3da5

Please sign in to comment.