Completed
Push — master ( a739bd...7ba4fa )
by ARCANEDEV
05:29
created

Notifyable::notifyInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php namespace Arcanesoft\Core\Traits;
2
3
/**
4
 * Class     Notifyable
5
 *
6
 * @package  Arcanesoft\Foundation\Traits
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
trait Notifyable
10
{
11
    /* ------------------------------------------------------------------------------------------------
12
     |  Main Functions
13
     | ------------------------------------------------------------------------------------------------
14
     */
15
    /**
16
     * Get the notification instance.
17
     *
18
     * @return \Arcanesoft\Core\Helpers\Notification
19
     */
20
    protected function notification()
21
    {
22
        return notification();
23
    }
24
25
    /**
26
     * Notify a success alert.
27
     *
28
     * @param  string  $title
29
     * @param  string  $message
30
     */
31
    protected function notifySuccess($title, $message = '')
32
    {
33
        $this->notification()->success($title, $message);
34
    }
35
36
    /**
37
     * Notify a danger alert.
38
     *
39
     * @param  string  $title
40
     * @param  string  $message
41
     */
42
    protected function notifyDanger($title, $message = '')
43
    {
44
        $this->notification()->danger($title, $message);
45
    }
46
47
    /**
48
     * Notify a warning alert.
49
     *
50
     * @param  string  $title
51
     * @param  string  $message
52
     */
53
    protected function notifyWarning($title, $message = '')
54
    {
55
        $this->notification()->warning($title, $message);
56
    }
57
58
    /**
59
     * Notify an info alert.
60
     *
61
     * @param  string  $title
62
     * @param  string  $message
63
     */
64
    protected function notifyInfo($title, $message = '')
65
    {
66
        $this->notification()->warning($title, $message);
67
    }
68
}
69