<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::feeds('feeds');

Route::get('/', [App\Http\Controllers\Front\FrontHomeController::class, 'home'])->name('front.home')->middleware('cacheResponse:1800');

Route::get('/terms', [App\Http\Controllers\Front\FrontHomeController::class, 'terms'])->name('front.terms')->middleware('cacheResponse:2630000');

Route::get('/privacy', [App\Http\Controllers\Front\FrontHomeController::class, 'privacy'])->name('front.privacy')->middleware('cacheResponse:2630000');

Route::get('/disclaimer', [App\Http\Controllers\Front\FrontHomeController::class, 'disclaimer'])->name('front.disclaimer')->middleware('cacheResponse:2630000');

Route::get('/bites', [App\Http\Controllers\Front\FrontListController::class, 'index'])->name('front.all')->middleware('cacheResponse:1800');

Route::post('/search', [App\Http\Controllers\Front\FrontListController::class, 'search'])->name('front.search');

Route::get('/bites/{query}', [App\Http\Controllers\Front\FrontListController::class, 'searchResults'])->name('front.search.results')->middleware('cacheResponse:1800');

Route::get('/{category_slug}/{slug}', [App\Http\Controllers\Front\FrontPostController::class, 'index'])->name('front.post');

Route::get('/{category_slug}', [App\Http\Controllers\Front\FrontListController::class, 'category'])
    ->where('category_slug', '^(updates|opinions|features|new-launches|how-tos|reviews)$')
    ->name('front.category')->middleware('cacheResponse:1800');
