Test Failed
Branch master (d26f96)
by Philippe
02:12
created

MediaLibraryController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 1
1
<?php
2
3
namespace Thinktomorrow\AssetLibrary\Http\Controllers;
4
5
use App\Http\Controllers\Controller;
6
use Illuminate\Pagination\Paginator;
7
use Thinktomorrow\AssetLibrary\Models\Asset;
8
use Illuminate\Pagination\LengthAwarePaginator;
9
10
class MediaLibraryController extends Controller
11
{
12
    public function index()
13
    {
14
        $library = Asset::getAllAssets();
15
16
        $library = new LengthAwarePaginator(
17
            $library->forPage(Paginator::resolveCurrentPage(), 8),
18
            count($library),
19
            8,
20
            Paginator::resolveCurrentPage(),
21
            [
22
                'path' => Paginator::resolveCurrentPath(),
23
            ]);
24
25
        return view('back.media', compact('library'));
26
    }
27
}
28