Completed
Push — master ( e7495c...b3c94b )
by Abdelrahman
33:39
created

PagesController::__invoke()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Pages\Http\Controllers\Frontarea;
6
7
use Illuminate\Http\Request;
8
use Illuminate\Routing\Controller;
9
10
class PagesController extends Controller
11
{
12
    public function __invoke(Request $request)
13
    {
14
        $uri = trim(str_replace('{locale}', '', $request->route()->uri()), " \t\n\r\0\x0B/") ?: '/';
15
16
        $page = app('rinvex.pages.page')->where('uri', $uri)->where('domain', $request->route()->domain() ?: null)->first();
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 124 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
17
18
        return view($page->view, compact('page'));
19
    }
20
}
21