Answers for "LARAVEL DB::"

PHP
2

DB: in eloquent using sql

$results = DB::select('select * from users where id = :id', ['id' => 1]);
Posted by: Guest on June-11-2020
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

Browse Popular Code Answers by Language