Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel old value for select option

@foreach($services as $service)
	@if (old('category') == $service->id)
  		<option value="{{ $service->id }}" selected>{{ $service->title }}</option>
  	@else
		<option value="{{ $service->id }}">{{ $service->title }}</option>
	@endif
@endforeach
 
PREVIOUS NEXT
Tagged: #laravel #select #option
ADD COMMENT
Topic
Name
4+5 =