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

PagesController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 3
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