Conditions | 2 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function updateTechTipFav($tipID) |
||
21 | { |
||
22 | $favData = TechTipFavs::where('tip_id', $tipID)->where('user_id', $this->userID)->first(); |
||
23 | |||
24 | if($favData) |
||
25 | { |
||
26 | Log::info('Tech Tip Bookmark removed. Detais', [ |
||
27 | 'user_id' => $this->userID, |
||
28 | 'tip_id' => $tipID, |
||
29 | ]); |
||
30 | $favData->delete(); |
||
31 | } |
||
32 | else |
||
33 | { |
||
34 | TechTipFavs::create([ |
||
35 | 'user_id' => $this->userID, |
||
36 | 'tip_id' => $tipID, |
||
37 | ]); |
||
38 | Log::info('Tech Tip Bookmark added. Detais', [ |
||
39 | 'user_id' => $this->userID, |
||
40 | 'tip_id' => $tipID, |
||
41 | ]); |
||
42 | } |
||
43 | |||
44 | return true; |
||
45 | } |
||
74 |