| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 2 | public function createTipComment(TechTipNewCommentRequest $request) |
|
| 21 | { |
||
| 22 | 2 | TechTipComments::create([ |
|
| 23 | 2 | 'tip_id' => $request->tip_id, |
|
| 24 | 2 | 'user_id' => Auth::user()->user_id, |
|
| 25 | 2 | 'comment' => $request->comment, |
|
| 26 | ]); |
||
| 27 | |||
| 28 | // Notify the Tech Tip Owner |
||
| 29 | 2 | $ownerID = TechTips::find($request->tip_id)->user_id; |
|
| 30 | 2 | $owner = User::find($ownerID); |
|
| 31 | |||
| 32 | 2 | Notification::send($owner, new NewTechTipComment(Auth::user()->full_name, $request->tip_id)); |
|
| 33 | |||
| 34 | 2 | Log::info('User '.Auth::user()->full_name.' commented on Tech Tip ID '.$request->tip_id.'. Details - ', array($request)); |
|
| 35 | 2 | return true; |
|
| 36 | } |
||
| 47 |