close #99
This commit is contained in:
parent
971a86abf4
commit
afb0bb6c03
@ -29,10 +29,18 @@ class Currencies extends Controller
|
|||||||
*/
|
*/
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
|
// Get current currencies
|
||||||
|
$current = Currency::pluck('code')->toArray();
|
||||||
|
|
||||||
// Prepare codes
|
// Prepare codes
|
||||||
$codes = array();
|
$codes = array();
|
||||||
$currencies = MoneyCurrency::getCurrencies();
|
$currencies = MoneyCurrency::getCurrencies();
|
||||||
foreach ($currencies as $key => $item) {
|
foreach ($currencies as $key => $item) {
|
||||||
|
// Don't show if already available
|
||||||
|
if (in_array($key, $current)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$codes[$key] = $key;
|
$codes[$key] = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,10 +85,18 @@ class Currencies extends Controller
|
|||||||
*/
|
*/
|
||||||
public function edit(Currency $currency)
|
public function edit(Currency $currency)
|
||||||
{
|
{
|
||||||
|
// Get current currencies
|
||||||
|
$current = Currency::pluck('code')->toArray();
|
||||||
|
|
||||||
// Prepare codes
|
// Prepare codes
|
||||||
$codes = array();
|
$codes = array();
|
||||||
$currencies = MoneyCurrency::getCurrencies();
|
$currencies = MoneyCurrency::getCurrencies();
|
||||||
foreach ($currencies as $key => $item) {
|
foreach ($currencies as $key => $item) {
|
||||||
|
// Don't show if already available
|
||||||
|
if (($key != $currency->code) && in_array($key, $current)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$codes[$key] = $key;
|
$codes[$key] = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user