I create a fuction for checking selected option and I want to call it in the for the selected part.
@foreach ($stocks as $stock)
<option value="{{ $stock->id }}" ..... > {{ $stock->name }}</option>
@endforeach
for the .... should be the place to call the function that I created but I don't know how to call it. I tried :
@foreach ($stocks as $stock)
<option value="{{ $stock->id }}" {{ CheckCombo($stock->id, $product-
product_type }} > {{ $stock->name }}</option>
@endforeach
for the function CheckCombo, it returns 'selected' back.