Currency code test.

This commit is contained in:
James Cole
2017-12-25 09:00:09 +01:00
parent 56ae279c96
commit 5cb948d0f3
2 changed files with 79 additions and 26 deletions

View File

@@ -38,9 +38,11 @@ class CurrencyCode implements BinderInterface
*/
public static function routeBinder($value, $route)
{
$currency = TransactionCurrency::where('code', $value)->first();
if (null !== $currency) {
return $currency;
if (auth()->check()) {
$currency = TransactionCurrency::where('code', $value)->first();
if (null !== $currency) {
return $currency;
}
}
throw new NotFoundHttpException;
}