Search
 
SCRIPT & CODE EXAMPLE
 

PHP

add selected to dropdpown item laravel

@foreach ($categories as $category)
    <option value="{{ $category->id }}"{{ $category->id === $post->category_id ? ' selected' : '' }}>{{ $category->name }}</option>
@endforeach
Comment

PREVIOUS NEXT
Code Example
Php :: code on editing an image in database in php 
Php :: Composer detected issues in your platform: Your Composer dependencies require a PHP version "= 7.4.0". 
Php :: Formatting an Excel Column 
Php :: Create mocking dependency in unit test Laravel 
Php :: if no data show msg and chang style laravel 
Php :: php run python script with arguments json 
Php :: get basename without extension Laravel 
Php :: nested relation 
Php :: Define Events in Model 
Php :: wordpress redirect attachment page to file 
Php :: PHP vsprintf — Return a formatted string 
Php :: add attribute validation lang laravel 
Php :: php store html in varible 
Php :: Natural numbers from php 
Php :: functions file erased wordpress 
Php :: java script clear rectangle 
Php :: laravel make model controller migration -mcr 
Php :: Laravel model - CRUD only with records where one column = certain value 
Php :: remove public from laravel 8 url 
Php :: laravel One to Many relationship using custom primary keys 
Php :: mysqli_fetch_all() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocscomplete-blog-phpadminincludespost_functions.php on line 31 
Php :: redaxo urlGenerator, urlGenerator::getId(), Class "UrlGenerator" not found 
Php :: php display result from html 
Php :: add column in exesting table 
Php :: oder system make in laravel 
Php :: php The function is a conversion from a key to a value 
Php :: send notification php to PC 
Php :: refresh_ttl 
Php :: cURL error 60 : SSL certificate in Larvel in pusher or facebook authentication 
Php :: Best version control tools for php 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =