| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public static function createForEvent(ShouldBeStored $event): self |
||
| 23 | { |
||
| 24 | $storedEvent = new static(); |
||
| 25 | $storedEvent->event_class = get_class($event); |
||
| 26 | $storedEvent->attributes['event_properties'] = app(EventSerializer::class)->serialize(clone $event); |
||
| 27 | $storedEvent->created_at = now(); |
||
| 28 | $storedEvent->save(); |
||
| 29 | |||
| 30 | return $storedEvent; |
||
| 31 | } |
||
| 32 | |||
| 56 |