. */ declare(strict_types=1); namespace FireflyIII\Support\Binder; use FireflyIII\Models\TransactionCurrency; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * Class CurrencyCode. */ class CurrencyCode implements BinderInterface { /** * @param $value * @param $route * * @return mixed */ public static function routeBinder($value, $route) { $currency = TransactionCurrency::where('code', $value)->first(); if (null !== $currency) { return $currency; } throw new NotFoundHttpException; } }