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

use Illuminate\Support\Facades\Route;
use Seka\Vzdelavanie\Http\Controllers\Api\Frontend\Kniznica\OblubeneController;
use Seka\Vzdelavanie\Http\Controllers\Api\Frontend\Kniznica\VyhladavanieController;

Route::prefix('/rest/vzdelavanie/kniznica/')
    ->middleware(['web', 'permission:vzdelavanie|vzdelavanie_kniznica|vzdelavanie_kniznica.zobrazit'])
    ->group(function () {
        Route::apiResource('vyhladavanie', VyhladavanieController::class)
            ->names([
                'index' => 'api.vzdelavanie.kniznica.vyhladavanie.index',
            ])
            ->only([
                'index',
            ]);

        Route::apiResource('oblubene', OblubeneController::class)
            ->parameters([
                'oblubene' => 'vzdPzvtlKnzncOblbnId',
            ])
            ->names([
                'store' => 'api.vzdelavanie.kniznica.oblubene.store',
                'destroy' => 'api.vzdelavanie.kniznica.oblubene.destroy',
            ])
            ->only([
                'store',
                'destroy',
            ]);
    }
);
