NotificationController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A edit() 0 5 1
A destroy() 0 5 1
1
<?php
2
3
namespace App\Http\Controllers\Home;
4
5
use App\Http\Controllers\Controller;
6
use Illuminate\Http\Request;
7
use Illuminate\Support\Facades\Auth;
8
9
class NotificationController extends Controller
10
{
11
    /**
12
     * Mark a notification as read
13
     */
14
    public function edit($id)
15
    {
16
        Auth::user()->notifications()->where('id', $id)->first()->markAsRead();
17
18
        return Auth::user()->notifications;
19
    }
20
21
    /**
22
     * Remove a user notification
23
     */
24
    public function destroy($id)
25
    {
26
        Auth::user()->notifications()->where('id', $id)->first()->delete();
27
28
        return Auth::user()->notifications;
29
    }
30
}
31