Skip to content

Commit

Permalink
close #99
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Nov 28, 2017
1 parent 971a86a commit afb0bb6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/Http/Controllers/Settings/Currencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,18 @@ public function index()
*/
public function create()
{
// Get current currencies
$current = Currency::pluck('code')->toArray();

// Prepare codes
$codes = array();
$currencies = MoneyCurrency::getCurrencies();
foreach ($currencies as $key => $item) {
// Don't show if already available
if (in_array($key, $current)) {
continue;
}

$codes[$key] = $key;
}

Expand Down Expand Up @@ -77,10 +85,18 @@ public function store(Request $request)
*/
public function edit(Currency $currency)
{
// Get current currencies
$current = Currency::pluck('code')->toArray();

// Prepare codes
$codes = array();
$currencies = MoneyCurrency::getCurrencies();
foreach ($currencies as $key => $item) {
// Don't show if already available
if (($key != $currency->code) && in_array($key, $current)) {
continue;
}

$codes[$key] = $key;
}

Expand Down

0 comments on commit afb0bb6

Please sign in to comment.