Completed
Push — develop ( 309d0f...13c676 )
by Abdelrahman
01:03
created

PagesController::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Pages\Http\Controllers;
6
7
use Illuminate\Http\Request;
8
use Rinvex\Pages\Models\Page;
9
use Illuminate\Routing\Controller;
10
11
class PagesController extends Controller
12
{
13
    public function __invoke(Request $request)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
14
    {
15
        $page = Page::where('uri', $request->route()->uri())->where('domain', $request->route()->domain())->first();
16
17
        return view($page->view, compact('page'));
18
    }
19
}
20