Answers for "laravel select data when using with()"

PHP
0

how to retrieve data from database using select option in laravel

<select class="form-control" name="product_id">
    <option>Select Product</option>
    @foreach ($products as $key => $value)
        <option value="{{ $key }}" {{ ( $key == $selectedID) ? 'selected' : '' }}> 
            {{ $value }} 
        </option>
    @endforeach    
</select>
Posted by: Guest on September-22-2021
0

laravel with select

$books = Book::with('author:id,name,book_id')->get();
Posted by: Guest on December-07-2021

Code answers related to "laravel select data when using with()"

Browse Popular Code Answers by Language