feat: ship creator journey v2 and profile updates
This commit is contained in:
39
app/Observers/GroupReleaseContributorObserver.php
Normal file
39
app/Observers/GroupReleaseContributorObserver.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Models\GroupReleaseContributor;
|
||||
use App\Services\Profile\CreatorJourneyService;
|
||||
|
||||
final class GroupReleaseContributorObserver
|
||||
{
|
||||
public function __construct(private readonly CreatorJourneyService $journeys)
|
||||
{
|
||||
}
|
||||
|
||||
public function created(GroupReleaseContributor $contributor): void
|
||||
{
|
||||
$this->journeys->requestRebuild((int) $contributor->user_id);
|
||||
}
|
||||
|
||||
public function updated(GroupReleaseContributor $contributor): void
|
||||
{
|
||||
$this->journeys->requestRebuild((int) $contributor->user_id);
|
||||
|
||||
if ($contributor->wasChanged('user_id')) {
|
||||
$this->journeys->requestRebuild((int) $contributor->getOriginal('user_id'));
|
||||
}
|
||||
}
|
||||
|
||||
public function deleted(GroupReleaseContributor $contributor): void
|
||||
{
|
||||
$this->journeys->requestRebuild((int) $contributor->user_id);
|
||||
}
|
||||
|
||||
public function forceDeleted(GroupReleaseContributor $contributor): void
|
||||
{
|
||||
$this->journeys->requestRebuild((int) $contributor->user_id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user