Total Complexity | 3 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
19 | trait InteractionRelationship |
||
20 | { |
||
21 | /** |
||
22 | * Like has one relationship with the model. |
||
23 | * |
||
24 | * @return MorphOne |
||
25 | */ |
||
26 | public function likeOne(): MorphOne |
||
27 | { |
||
28 | return $this->morphOne(Like::class, 'model'); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Like has many relationship with the model. |
||
33 | * |
||
34 | * @return MorphMany |
||
35 | */ |
||
36 | public function likes(): MorphMany |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Get the interaction type. |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public function interactionType(): string |
||
51 |