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

ContentController::show()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 2
dl 0
loc 10
rs 10
c 0
b 0
f 0
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