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

ShopController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
rs 10
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