ExchangeController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A index() 0 7 1
1
<?php
2
3
namespace App\Http\Controllers\Admin;
4
5
use Illuminate\Support\Facades\DB;
6
use App\Http\Controllers\Controller;
7
use App\Judite\Contracts\Registry\ExchangeRegistry;
8
9
class ExchangeController extends Controller
10
{
11
    /**
12
     * Create a new controller instance.
13
     */
14
    public function __construct()
15
    {
16
        $this->middleware('auth');
17
        $this->middleware('can.admin');
18
    }
19
20
    /**
21
     * Display a listing of the resource.
22
     *
23
     * @return \Illuminate\View\View
24
     */
25
    public function index(ExchangeRegistry $registry)
26
    {
27
        $history = DB::transaction(function () use ($registry) {
28
            return $registry->paginate();
29
        });
30
31
        return view('exchanges.index', compact('history'));
32
    }
33
}
34