Passed
Push — master ( 55010d...cba042 )
by Matthijs
06:10
created

ErrorController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 17 2
1
<?php namespace App\Http\Controllers\Backend;
2
3
use App\Http\Controllers\Controller;
4
5
use Hideyo\Ecommerce\Framework\Services\Exception\ExceptionFacade as ExceptionService;
0 ignored issues
show
Bug introduced by
The type Hideyo\Ecommerce\Framewo...ception\ExceptionFacade was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
use Illuminate\Http\Request;
8
use Notification;
9
10
class ErrorController extends Controller
11
{
12
13
    public function index(Request $request)
14
    {
15
        if ($request->wantsJson()) {
16
17
            $query = ExceptionService::getModel();
18
            
19
            $datatables = \DataTables::of($query)->addColumn('action', function ($query) {
20
                $deleteLink = \Form::deleteajax('/admin/general-setting/'. $query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
21
                $links = '<a href="/admin/general-setting/'.$query->id.'/edit" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>  '.$deleteLink;
22
            
23
                return $links;
24
            });
25
26
            return $datatables->make(true);
27
28
        } else {
29
            return view('backend.error.index')->with('error', ExceptionService::selectAll());
30
        }
31
    }
32
}
33