public static function currencies(string $currency = null) : Collection
    {
        $currency = strtoupper($currency);

        $file = __DIR__ . "/../Assets/Currencies.json";
        $json = json_decode(file_get_contents($file), true);

        if ($currency) {
            return Collection::make($json[$currency]);
        }

        return Collection::make($json);
    }
public static function currencies(string $currency = null) : Collection
    {
        $currency = strtoupper($currency);

        $file = __DIR__ . "/../Assets/Currencies.json";
        $json = json_decode(file_get_contents($file), true);

        if ($currency) {
            return Collection::make($json[$currency]);
        }

        return Collection::make($json);
    }
public static function currencies ( string $ currency = null ) : Collection { $ currency = strtoupper ( $ currency ) ; $ file = __DIR__ . "/../Assets/Currencies.json" ; $ json = json_decode ( file_get_contents ( $ file ) , true ) ; if ( $ currency ) { return Collection :: make ( $ json [ $ currency ] ) ; } return Collection :: make ( $ json ) ; }
Return all the currencies or the one specified.

@author Erik Campobadal Fores <soc@erik.cat>
@copyright 2017 erik.cat
@param string|null $currency
@return Collection
Return all the currencies or the one specified .