Destroy   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
dl 0
loc 25
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildUrl() 0 3 1
A render() 0 5 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