Skip to content

Commit

Permalink
Added the touching of parent to the Channelable trait on assign/rem…
Browse files Browse the repository at this point in the history
…ove channels
  • Loading branch information
fulopattila122 committed Sep 25, 2024
1 parent 2c16910 commit 4a826a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- Added `domain` field to the orders table
- Added then automatic completion of `$order->domain` from the current request to the OrderFactory
- Added the `promotions_total` attribute getter to the Foundation `Order` model
- Added the touching of parent to the `Channelable` trait on assign/remove channels

## 4.1.0
##### 2024-07-11
Expand Down
1 change: 1 addition & 0 deletions src/Channel/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
##### 2024-XX-YY

- Changed `Channel::hasConfiguration()` to return false on empty arrays as well
- Added the touching of parent to the `Channelable` trait on assign/remove channels

## 4.1.0
##### 2024-07-11
Expand Down
2 changes: 2 additions & 0 deletions src/Channel/Traits/Channelable.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ public function isNotInChannel(Channel|int|string $channel): bool
public function assignChannels(array|Model|Collection $channels): void
{
$this->channels()->sync($channels);
$this->touch();
}

public function removeFromAllChannels(): void
{
$this->channels()->detach();
$this->touch();
}

public function scopeWithinChannels(Builder $query, Collection|Channel|array $channels): Builder
Expand Down

0 comments on commit 4a826a6

Please sign in to comment.