laravel DB get code example
Example 1: TRANSACTON LARAVEL QUERY BUILDER
DB::beginTransaction();
try {
DB::insert(...);
DB::commit();
} catch (\Throwable $e) {
DB::rollback();
throw $e;
}
Example 2: DB::table('users')->get();
DB::select('SELECT * FROM users WHERE name = ?', array(Input::get('name')));