Answers for "laravel sql query"

SQL
2

laravel to sql

DB::table('users')->toSql()
Posted by: Guest on March-29-2021
5

laravel db query

$users = DB::table('users')
            ->where('votes', '>', 100)
            ->orWhere(function($query) {
                $query->where('name', 'Abigail')
                      ->where('votes', '>', 50);
            })
            ->get();
Posted by: Guest on April-30-2021
1

db::statement in laravel

DB::statement('DROP TABLE users');
DB::statement('ALTER TABLE projects AUTO_INCREMENT=123');
Posted by: Guest on July-27-2020
7

laravel wher in

$users = DB::table('users')
                    ->whereIn('id', [1, 2, 3])
                    ->get();
Posted by: Guest on April-30-2020
0

laravel sql query

use Illuminate\Support\Facades\DB;

$users = DB::select('select * from users');

foreach ($users as $user) {
    echo $user->name;
}
Posted by: Guest on January-07-2021
1

db name laravel

DB::connection()->getDatabaseName() //laravel
Posted by: Guest on October-30-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language