Passed
Push — master ( dff497...d8daf2 )
by Churakov
03:17
created

Update::buildUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ChurakovMike\EasyGrid\Columns\Actions;
4
5
/**
6
 * Class Update.
7
 * @package ChurakovMike\EasyGrid\Columns\Actions
8
 */
9
class Update extends BaseButton
10
{
11
    const ACTION = 'edit';
12
13
    /**
14
     * @param $row
15
     * @return array|string
16
     * @throws \Throwable
17
     */
18
    public function render($row)
19
    {
20
        return view('churakovmike_easygrid::actions.update', [
21
            'url' => $this->getUrl($row),
22
        ])->render();
23
    }
24
25
    /**
26
     * Build link to edit page.
27
     *
28
     * @param $row
29
     * @return string
30
     */
31
    public function buildUrl($row)
32
    {
33
        return $this->getCurrentUrl() . '/' . $row->id . '/' . self::ACTION;
34
    }
35
}
36