<?php

namespace App\Repositories;

use League\Flysystem\FileNotFoundException;

class FileRepository {
    public static function asset($file) {

        if(!file_exists(resource_path("img/" . $file))) {
            throw new FileNotFoundException("No se ha encontrado el asset $file");
        }

        return resource_path("img/" . $file);
    }

    public static function storage($file) {

        if(!file_exists(public_path("storage/" . $file))) {
            throw new FileNotFoundException("No se ha encontrado el archivo $file");
        }

        return public_path("storage/" . $file);
    }
}
