Answers for "laravel select from database"

PHP
2

wherein laravel

DB::table('user')->whereIn('id', [100,200])->get();
Posted by: Guest on December-16-2020
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
4

TRANSACTON LARAVEL QUERY BUILDER

DB::beginTransaction();

try {
    DB::insert(...);    
    DB::commit();
} catch (\Throwable $e) {
    DB::rollback();
    throw $e;
}
Posted by: Guest on September-22-2020

Code answers related to "laravel select from database"

Browse Popular Code Answers by Language