<?php

use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return view('welcome');
});

// Ruta para servir archivos del storage (xml, cdrs, users, etc)
Route::get('/storage/{type}/{filename}', function ($type, $filename) {
    $path = storage_path("app/public/{$type}/{$filename}");
    
    if (!file_exists($path)) {
        abort(404, 'Archivo no encontrado');
    }
    
    return response()->file($path);
})->where(['type' => '.*', 'filename' => '.*']);
