Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

monicahq/monica

23656 stars
2 code files
View monicahq/monica on GitHub

app/Http/ViewComposers/CurrencySelectViewComposer.php

Open in GitHub
use Illuminate\View\View;
use App\Models\Settings\Currency;
 
class CurrencySelectViewComposer
{
public function compose(View $view)
{
$currencies = Currency::orderBy('name', 'asc')->get();
$view->with('currencies', $currencies);
}
}

resources/views/partials/components/currency-select.blade.php

Open in GitHub
<select name="currency_id" id="currency_id" class="form-control" required>
@foreach ( $currencies as $currency )
@if ($currency->id == $selectionID)
<option value="{{ $currency->id }}" selected>{{ $currency->name }}</option>
@else
<option value="{{ $currency->id }}" >{{ $currency->name }}</option>
@endif
@endforeach
</select>

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.