Destroy::render()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace ChurakovMike\EasyGrid\Columns\Actions;
4
5
/**
6
 * Class Destroy.
7
 * @package ChurakovMike\EasyGrid\Columns\Actions
8
 */
9
class Destroy extends BaseButton
10
{
11
    const ACTION = 'delete';
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.destroy', [
21
            'url' => $this->getUrl($row),
22
        ])->render();
23
    }
24
25
    /**
26
     * Build link to edit delete item.
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