Completed
Push — master ( 03841e...c8ea4b )
by Sherif
05:27
created

NotificationsController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getNotified() 0 4 1
A getNotifyall() 0 4 1
1
<?php
2
namespace App\Modules\Notifications\Http\Controllers;
3
4
use Illuminate\Foundation\Http\FormRequest;
5
use Illuminate\Http\Request;
6
use App\Modules\Core\Http\Controllers\BaseApiController;
7
8
class NotificationsController extends BaseApiController
9
{
10
	/**
11
     * The name of the model that is used by the base api controller 
12
     * to preform actions like (add, edit ... etc).
13
     * @var string
14
     */
15
    protected $model            = 'notifications';
16
17
    /**
18
     * Set the notification notified to true.
19
     * 
20
     * @param  integer  $id
21
     * @return \Illuminate\Http\Response
22
     */
23
    public function getNotified($id)
24
    {
25
        return \Response::json(\Core::notifications()->notified($id), 200);
26
    }
27
28
    /**
29
     * Set the notification notified to all.
30
     * 
31
     * @return \Illuminate\Http\Response
32
     */
33
    public function getNotifyall()
34
    {
35
        return \Response::json(\Core::notifications()->notifyAll(), 200);
36
    }
37
}
38