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

use Illuminate\Support\Facades\Route;

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'])
    ->namespace('Seka\Vzdelavanie\Http\Controllers')
    ->name('vzdelavanie.')
    ->group(function () {
        Route::prefix('sprava')
            ->namespace('Backend')
            ->name('sprava.')
            ->group(function () {
                Route::get('/', 'SpravaController@index')
                    ->name('index');
            });
    });
