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

use Illuminate\Support\Facades\Route;
use Seka\Vzdelavanie\Http\Controllers\Backend\SpravaController;

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'])
    ->name('vzdelavanie.')
    ->group(function () {
        Route::prefix('sprava')
            ->name('sprava.')
            ->group(function () {
                Route::get('/', [SpravaController::class, 'index'])
                    ->name('index');
            });
    });
