<?php

namespace App\Console\Commands\Converters;

use Illuminate\Support\Facades\Storage;

class Converter
{
    public static function getDataFromFile($filename, $directory = null)
    {
        $path = $directory.'/'.$filename;

        if(!Storage::exists($path)) {
            return null;
        }
        
        $fileContent = Storage::get($path);

        return json_decode($fileContent, true);
    }
}