<?php

use App\Http\Controllers\Admin\LaravelLogController;
use Illuminate\Support\Facades\Route;

Route::middleware(['auth', 'permission:system.settings.manage'])
    ->prefix('admin')
    ->name('admin.')
    ->group(function (): void {
        Route::get('/laravel-logs', [LaravelLogController::class, 'index'])->name('laravel-logs.index');
        Route::get('/laravel-logs/{filename}/download', [LaravelLogController::class, 'download'])
            ->where('filename', '[A-Za-z0-9._-]+\.log')
            ->name('laravel-logs.download');
        Route::post('/laravel-logs/{filename}/clear', [LaravelLogController::class, 'clear'])
            ->where('filename', '[A-Za-z0-9._-]+\.log')
            ->name('laravel-logs.clear');
        Route::delete('/laravel-logs/{filename}', [LaravelLogController::class, 'destroy'])
            ->where('filename', '[A-Za-z0-9._-]+\.log')
            ->name('laravel-logs.destroy');
    });
