Test Failed
Push — master ( 83b4ef...37cc60 )
by Gianluca
19:45 queued 19:45
created

ShopController::page()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
4
namespace Mongi\Mongicommerce\Http\Controllers\shop;
5
6
7
use Mongi\Mongicommerce\Http\Controllers\Controller;
8
use Mongi\Mongicommerce\Libraries\Template;
9
use Mongi\Mongicommerce\Models\Category;
10
use Mongi\Mongicommerce\Models\Product;
11
12
class ShopController extends Controller
13
{
14
    public function page($id=null){
15
        $products = Template::getProducts($id);
16
        $category = Category::find($id);
17
        $category_name = '';
18
        if($category){
19
            $category_name = $category->name;
20
        };
21
        return view('mongicommerce.pages.shop',compact('products','category_name'));
22
    }
23
}
24