<?php

use ViartasCore\Core\Facades\Route;
use ViartasCore\Comments\Controllers\Web\FrontendCommentController;

/*
|--------------------------------------------------------------------------
| Comments Frontend Routes (API)
|--------------------------------------------------------------------------
*/

Route::prefix(config('comments.frontend_prefix', 'api/comments'))
    ->middleware(config('comments.frontend_middleware', ['web']))
    ->group(function () {

        Route::prefix('{model_type}/{model_id}')->group(function () {
            Route::get('/', [FrontendCommentController::class, 'index'])->name('comments.frontend.index');
            Route::post('/', [FrontendCommentController::class, 'store'])->name('comments.frontend.store');
        });
    });
