Completed
Push — master ( a48014...2e2645 )
by Jianhua
03:54
created

ContentController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A show() 0 10 1
1
<?php
2
3
namespace App\Http\Controllers\Front;
4
5
use App\Model\Admin\Entity;
6
use App\Repository\Admin\ContentRepository;
7
8
class ContentController extends BaseController
9
{
10
    public function show($entityId, $contentId)
11
    {
12
        $entity = Entity::query()->findOrFail($entityId);
13
14
        ContentRepository::setTable($entity->table_name);
15
        $content = ContentRepository::findOrFail($contentId);
16
17
        return view(
18
            'front.content.show',
19
            array_merge(['content' => $content, 'entityId' => $entityId], ContentRepository::adjacent($contentId))
20
        );
21
    }
22
}
23