Answers for "laravel make sql query"

PHP
2

laravel to sql

DB::table('users')->toSql()
Posted by: Guest on March-29-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
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
2

DB: in eloquent using sql

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

Browse Popular Code Answers by Language