Passed
Pull Request — master (#92)
by Fèvre
13:40 queued 08:22
created

ShopController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 9 1
1
<?php
2
namespace Xetaravel\Http\Controllers\Shop;
3
4
use Illuminate\View\View;
5
use Xetaravel\Models\ShopItem;
6
7
class ShopController extends Controller
8
{
9
    /**
10
     * Display all items.
11
     *
12
     * @return \Illuminate\View\View
13
     */
14
    public function index(): View
15
    {
16
        $items = ShopItem::with('shopCategory', 'users')
17
            ->orderByDesc('created_at')
18
            ->paginate(config('xetaravel.pagination.shop.item_per_page'));
19
20
        $breadcrumbs = $this->breadcrumbs;
21
22
        return view('Shop::index', compact('breadcrumbs', 'items'));
23
    }
24
}
25