<?php

// En App\Helpers\FileHelper.php
namespace App\Helpers;

class FileHelper
{
    public static function getFileType($filename)
    {
        $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
        
        return match($extension) {
            'pdf' => 'pdf',
            'doc', 'docx' => 'word',
            'xls', 'xlsx' => 'excel',
            'ppt', 'pptx' => 'powerpoint',
            'jpg', 'jpeg', 'png', 'gif' => 'image',
            'zip', 'rar' => 'archive',
            'txt' => 'text',
            default => 'document'
        };
    }
}