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 :: zero padding php 
Php :: laravel job delay dispatch 
Php :: laravel create project 
Php :: getting input value in session variable in php 
Php :: PHP MySQL Delete Data 
Php :: laravel guest blade 
Php :: php sort custom function 
Php :: rand string php 
Php :: str_replace smarty template 
Php :: if condition in smarty 
Php :: laravel pluck relationship 
Php :: request file create cammand laravel 
Php :: laravel routing techniques 
Php :: Reset Admin password in Magento 2 
Php :: uppercase php 
Php :: laravel check if string is url 
Php :: get from table laravel 
Php :: php extend parent constructor 
Php :: php strict mode 
Php :: limiting requests to controllers in laravel 
Php :: php PDO database crud class 
Php :: how to add share icon in wordpress 
Php :: laravel return view with multiple variable 
Php :: input file accept jpg jpeg png php 
Php :: how to include pdf in php page using embed tag 
Php :: get only the first two word from a string php 
Php :: concat php 
Php :: setup cron on macos for laravel 
Php :: php bcrypt password verify 
Php :: Array and string offset access syntax with curly braces is deprecated 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =