<?php

use Illuminate\Support\Facades\Route;

Route::get('/clear', function () {
    \Illuminate\Support\Facades\Artisan::call('optimize:clear');
});

Route::get('cron', 'CronController@cron')->name('cron');

Route::controller('SiteController')->group(function () {
    Route::get('/change/{lang?}', 'changeLanguage')->name('lang');
    Route::get('policy/{slug}', 'policyPages')->name('policy.pages');

    Route::get('placeholder-image/{size}', 'placeholderImage')->withoutMiddleware('maintenance')->name('placeholder.image');
    Route::get('maintenance-mode', 'maintenance')->withoutMiddleware('maintenance')->name('maintenance');

    Route::get('knowledge', 'knowledge')->name('knowledge');
    Route::get('category/{slug?}', 'category')->name('category');
    Route::get('knowledge-details/{id}', 'knowledgeDetails')->name('knowledge.details');
    Route::get('knowledge/comment/load/{id}', 'loadKnowledgeComment')->name('knowledge.comment.load');
    Route::get('view/count/store/{id}', 'storeViewCount')->name('knowledge.view.count.store');

    Route::get('department/form/load/{id}', 'loadDepartmentForm')->name('department.form.load');
    Route::get('/', 'index')->name('home');
});
