| 1 | <?php |
||
| 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 | * The methods that don't require api authentication |
||
| 33 | * |
||
| 34 | * @var array |
||
| 35 | */ |
||
| 36 | protected $apiMethods = [ |
||
| 37 | 'showBySlug' => [ |
||
| 38 | 'keyAuthentication' => false |
||
| 39 | ], |
||
| 40 | ]; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Returns a page and associated detail and template data |
||
| 44 | * |
||
| 45 | * @param string $slug |
||
| 46 | * @return \Illuminate\Http\JsonResponse |
||
| 47 | */ |
||
| 48 | public function showBySlug($slug) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Returns a page and associated detail and template data |
||
| 61 | * |
||
| 62 | * @param mixed $id |
||
| 63 | * @return \Illuminate\Http\JsonResponse |
||
| 64 | */ |
||
| 65 | public function showWithDetail($id) |
||
| 78 | |||
| 79 | } |