Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
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->meta_data = []; |
||
28 | $storedEvent->created_at = now(); |
||
29 | |||
30 | $storedEvent->save(); |
||
31 | |||
32 | return $storedEvent; |
||
33 | } |
||
34 | |||
53 |