Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 0 |
1 | <?php |
||
27 | 2 | public function read($id) |
|
28 | { |
||
29 | 2 | $notification = get_authenticated_user()->unreadNotifications()->find($id); |
|
30 | |||
31 | 2 | if ($notification === null) |
|
32 | throw new NotFoundHttpException("Could not find notification"); |
||
33 | |||
34 | 2 | $notification->markAsRead(); |
|
35 | 2 | return response()->json([ |
|
36 | 2 | "success" |
|
37 | ]); |
||
40 |