NotificationsController::markAsRead()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Modules\Notification\Http\Controllers\Api;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Routing\Controller;
7
use Modules\Notification\Repositories\NotificationRepository;
8
9
class NotificationsController extends Controller
10
{
11
    /**
12
     * @var NotificationRepository
13
     */
14
    private $notification;
15
16
    public function __construct(NotificationRepository $notification)
17
    {
18
        $this->notification = $notification;
19
    }
20
21
    public function markAsRead(Request $request)
22
    {
23
        $updated = $this->notification->markNotificationAsRead($request->get('id'));
24
25
        return response()->json(compact('updated'));
26
    }
27
}
28