Carts::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 6
loc 6
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php namespace Bedard\Shop\Controllers;
2
3
use Backend\Classes\Controller;
4
use BackendMenu;
5
6
/**
7
 * Carts Back-end Controller.
8
 */
9 View Code Duplication
class Carts extends Controller
10
{
11
    public $bodyClass = 'compact-container';
12
13
    public $formConfig = 'config_form.yaml';
14
15
    public $implement = [
16
        'Backend.Behaviors.FormController',
17
        'Backend.Behaviors.ListController',
18
        'Owl.Behaviors.ListDelete.Behavior',
19
    ];
20
21
    public $listConfig = 'config_list.yaml';
22
23
    public $registerPermissions = [
24
        'bedard.shop.carts.manage',
25
    ];
26
27
    public function __construct()
28
    {
29
        parent::__construct();
30
31
        BackendMenu::setContext('Bedard.Shop', 'shop', 'carts');
32
    }
33
34
    /**
35
     * Extend the list query.
36
     *
37
     * @param  \Illuminate\Database\Query\Builder $query
38
     * @return \Illuminate\Database\Query\Builder
39
     */
40
    public function listExtendQuery($query)
41
    {
42
        $query->with('statuses');
43
    }
44
}
45