Search
 
SCRIPT & CODE EXAMPLE
 

PHP

option selected in laravel blade

<option value="">--Select--</option>
@foreach($array as $key => $arr)
  <option value="{{++$key}}" {{ $selectedValue == $key ? 'selected' : '' }}> {{ $arr }}</option>
@endforeach
Comment

blade select selected

    @foreach ($categories as $item)
           @if (isset($produits->categorie_id) && $item->id == $produits->categorie_id || old('categorie_id') == $item->id)
                <option selected value="{{ $item->id }}">{{ $item->libelle }}</option>
           @else
                <option value="{{ $item->id }}">{{ $item->libelle }}</option>
           @endif
   @endforeach
Comment

laravel blade @selected

<select name="version">
    @foreach ($product->versions as $version)
        <option value="{{ $version }}" @selected(old('version') == $version)>
            {{ $version }}
        </option>
    @endforeach
</select>
Comment

PREVIOUS NEXT
Code Example
Php :: php convert guzzle response to json 
Php :: laravel response header 
Php :: concat in php 
Php :: cakephp get sql query string 
Php :: abort in laravel 
Php :: loop iteration laravel 
Php :: json encode decode php 
Php :: laravel model events 
Php :: laravel groupby and latest 
Php :: ubuntu 7.2 deleted php 
Php :: search in laravel 8 
Php :: php get keys of duplicate values in array 
Php :: Array and string offset access syntax with curly braces is deprecated 
Php :: laravel collection split 
Php :: php if elseif 
Php :: valid image extensions in php 
Php :: php numbers 
Php :: laravel migration integer 
Php :: show woocommerce product variation in table php 
Php :: how laravel return the old value 
Php :: laravel make model with migration 5.8 
Php :: check array is associative laravel 
Php :: laravel collection max 
Php :: php get item position in array 
Php :: laravel search 
Php :: php get first day of month 
Php :: laravel create controller 
Php :: how to upload two files on same form different path in codeigniter 
Php :: if request type is post 
Php :: random integer in php 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =