<?php
/**
 * Created by PhpStorm.
 * User: radko
 * Date: 13.11.18
 * Time: 8:11
 */

use Illuminate\Support\Facades\Route;
use Seka\Portal\Modul\Vzdelavanie\Http\Controllers\Frontend\KlientAppController;
use Seka\Portal\Modul\Vzdelavanie\Http\Controllers\Frontend\VzdelavanieController;

if ($domain = config('vzdelavanie.subdomena')) {
    $domain = sprintf(
        '%s.%s',
        $domain,
        config('app.domain'),
    );
}

$path = config('vzdelavanie.cesta');

Route::domain($domain)
    ->prefix($path)
    ->middleware(['web', 'auth', 'permission:vzdelavanie|vzdelavanie_kniznica|vzdelavanie_kniznica.zobrazit'])
    ->name('vzdelavanie.')
    ->group(function () {
        Route::get('/', [VzdelavanieController::class, 'index'])
            ->name('index');

        Route::get('/klient', [KlientAppController::class, 'show'])
            ->name('klient');
    });
