Completed
Push — master ( fd532c...18a507 )
by Song
04:27
created

QuickSearch::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
1
<?php
2
3
namespace Encore\Admin\Grid\Tools;
4
5
use Encore\Admin\Grid\Concerns\HasQuickSearch;
6
use Illuminate\Support\Arr;
7
8
class QuickSearch extends AbstractTool
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $view = 'admin::grid.quick-search';
14
15
    /**
16
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
17
     */
18
    public function render()
19
    {
20
        $query = request()->query();
21
22
        Arr::forget($query, HasQuickSearch::$searchKey);
23
24
        $vars = [
25
            'action' => request()->url() . '?' . http_build_query($query),
26
            'key'    => HasQuickSearch::$searchKey,
27
            'value'  => request(HasQuickSearch::$searchKey),
28
        ];
29
30
        return view($this->view, $vars);
0 ignored issues
show
Bug Compatibility introduced by
The expression view($this->view, $vars); of type Illuminate\View\View|Ill...\Contracts\View\Factory adds the type Illuminate\Contracts\View\Factory to the return on line 30 which is incompatible with the return type declared by the interface Illuminate\Contracts\Support\Renderable::render of type string.
Loading history...
31
    }
32
}