Completed
Push — master ( 963b04...ea61d1 )
by David
02:37
created

PageController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 1
cbo 2
dl 0
loc 40
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A showWithDetail() 0 9 1
1
<?php 
2
3
namespace App\Http\Controllers\Api\V1;
4
5
use App\Http\Controllers\Api\V1\ApiController;
6
use App\LaravelRestCms\Page\Page as Page;
7
8
class PageController extends ApiController
9
{
10
	/**
11
	 * The name of the model to use for this package
12
	 * 
13
	 * @var string
14
	 */
15
	protected $modelName = \App\LaravelRestCms\Page\Page::class;
16
    
17
	/**
18
	 * The name of the transformer to use for this package
19
	 * 
20
	 * @var string
21
	 */
22
	protected $transformerName = \App\LaravelRestCms\Page\PageTransformer::class;
23
    
24
	/**
25
	 * The key to use as a key for this collection in the output
26
	 * 
27
	 * @var string
28
	 */
29
	protected $collectionName = 'pages';
30
31
    /**
32
     * Returns a page and associated detail and template data
33
     * 
34
     * @param  int $id
35
     * @return \Illuminate\Http\JsonResponse
36
     */
37
    public function showWithDetail($id)
38
    {        
39
        $this->manager->parseIncludes([
40
        	'detail',
41
        	'detail.template_detail',
42
        ]);
43
44
        return $this->show($id);
45
    }
46
47
}