<?php
/**
 * Created by PhpStorm.
 * User: radko
 * Date: 2018-12-13
 * Time: 10:00
 */

Route::prefix('/api/vzdelavanie/')
    ->middleware('api')
    ->namespace('Seka\Vzdelavanie\Http\Controllers\Api')
    ->group(function () {
        Route::apiResource('kategorie', 'KategoriaController')
            ->names([
                'index' => 'api.kategoria.index',
            ])->only([
                'index',
            ]);

        Route::apiResource('ucebne-materialy', 'UcebnicaController')
            ->parameters([
                'ucebne-materialy' => 'id',
            ])->names([
                'index' => 'api.ucebnica.index',
                'show' => 'api.ucebnica.show',
            ])->only([
                'index',
                'show',
            ]);

        Route::apiResource('ucebne-materialy/{ucebnicaId}/sekcie', 'SekciaController')
            ->parameters([
                'sekcie' => 'ucebnicaId',
            ])->names([
                'index' => 'api.sekcia.index',
            ])->only([
                'index',
            ]);

        Route::apiResource('sekcie', 'SekciaController')
            ->parameters([
                'sekcie' => 'id',
            ])->names([
                'show' => 'api.sekcia.show',
            ])->only([
                'show',
            ]);

        Route::apiResource('vyhladavanie', 'VyhladavanieController')
            ->names([
                'index' => 'api.vyhladavanie.index',
            ])
            ->only([
                'index'
            ]);
    }
);
