| Conditions | 4 |
| Paths | 2 |
| Total Lines | 7 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function retrieved(RolePromotion $promotion): void |
||
| 28 | { |
||
| 29 | // If the promotion has an end date that has passed but is still marked as active, |
||
| 30 | // we update it (this will trigger saving event) |
||
| 31 | if ($promotion->is_active && $promotion->end_date && Carbon::now()->gt($promotion->end_date)) { |
||
| 32 | $promotion->is_active = false; |
||
| 33 | $promotion->saveQuietly(); // Save without triggering events to avoid recursion |
||
| 34 | } |
||
| 38 |