Passed
Push — develop ( a18085...de8258 )
by Francisco
14:47
created

ExchangeController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 7
rs 9.4285
c 1
b 0
f 0
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\Http\Response
24
     */
25
    public function index(ExchangeRegistry $exchangeLogger)
26
    {
27
        $history = DB::transaction(function () use ($exchangeLogger) {
28
            return $exchangeLogger->paginate();
29
        });
30
31
        return view('exchanges.index', compact('history'));
0 ignored issues
show
Bug Best Practice introduced by
The expression return view('exchanges.i...x', compact('history')) returns the type Illuminate\View\View which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
32
    }
33
}
34