mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-05-18 20:34:52 +00:00
🚀 **Automate Meetup Activity Recalculation**
- Introduced `recalculateActivity` method in `Meetup` model to centralize activity and event timestamp updates. - Added `MeetupEventObserver` to trigger activity recalculation on event save/delete. - Updated `/meetups:update-activity` command to leverage the new model method for cleanup. - Enhanced tests to cover various `MeetupEvent` scenarios affecting activity states.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Models\MeetupEvent;
|
||||
|
||||
class MeetupEventObserver
|
||||
{
|
||||
public function saved(MeetupEvent $meetupEvent): void
|
||||
{
|
||||
$meetupEvent->meetup?->recalculateActivity();
|
||||
}
|
||||
|
||||
public function deleted(MeetupEvent $meetupEvent): void
|
||||
{
|
||||
$meetupEvent->meetup?->recalculateActivity();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user