Conditions | 4 |
Paths | 8 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function __invoke($tipId) |
||
16 | { |
||
17 | $tip = TechTip::find($tipId); |
||
18 | $favorites = TechTipBookmark::where('tip_id', $tipId)->count(); |
||
19 | |||
20 | return [ |
||
21 | 'author' => $tip->CreatedBy->full_name, |
||
22 | 'dateCreated' => date('M d, Y', strtotime($tip->created_at)), |
||
23 | 'lastEdited' => $tip->updated_id !== null ? date('M d, Y', strtotime($tip->updated_at)) : null, |
||
24 | 'editedBy' => $tip->updated_id !== null ? $tip->UpdatedBy->full_name : null, |
||
25 | 'views' => $tip->views, |
||
26 | 'favorites' => $favorites, |
||
27 | 'isPinned' => $tip->sticky ? 'Yes' : 'No', |
||
28 | ]; |
||
31 |