<?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();

Auth::routes();

// Route::prefix('admin')->middleware('auth')->group(function () {

//     Route::get('/', [App\Http\Controllers\Admin\DashboardController::class, 'index'])->name('dashboard');

//     Route::view('/changelog', 'admin.changelog')->name('admin.changelog');

//     Route::view('about', 'admin.about')->name('about');

//     Route::get('users', [\App\Http\Controllers\Admin\UserController::class, 'index'])->name('users.index');

//     Route::get('posts', [\App\Http\Controllers\Admin\PostController::class, 'index'])->name('posts.manage');

//     Route::get('posts/edit/{post_id}', [\App\Http\Controllers\Admin\PostController::class, 'edit'])->name('posts.manage.edit');

//     Route::get('posts/delete/{post_id}', [\App\Http\Controllers\Admin\PostController::class, 'delete'])->name('posts.manage.delete');

//     Route::get('posts/indexing/{post_id}', [\App\Http\Controllers\Admin\PostController::class, 'indexing'])->name('posts.manage.indexing');

//     Route::get('posts/new', [\App\Http\Controllers\Admin\PostController::class, 'new'])->name('posts.manage.new');

//     Route::get('profile', [\App\Http\Controllers\Admin\ProfileController::class, 'show'])->name('profile.show');
//     Route::put('profile', [\App\Http\Controllers\Admin\ProfileController::class, 'update'])->name('profile.update');
// });

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

Route::prefix('discover')->group(function () {

    Route::get('/', [\App\Http\Controllers\Front\FrontDiscoverController::class, 'discover'])->name('front.discover.home');

    Route::get('/{category_slug}', [\App\Http\Controllers\Front\FrontDiscoverController::class, 'discover'])->name('front.discover.category');

});

Route::prefix('ai-search')->group(function () {

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

    Route::get('/{query}', [\App\Http\Controllers\Front\FrontSearchController::class, 'searchResult'])->name('front.search.results');

});

Route::prefix('ai-tool')->group(function () {

    Route::get('/{ai_tool_slug}', [\App\Http\Controllers\Front\FrontToolController::class, 'show'])->name('front.aitool.show')->middleware('cacheResponse:86400');

});

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');
