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

NotificationsController::getNotified()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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