Laravel 自由執行sql

一定要小心使用

use Illuminate\Support\Facades\DB;
//......
DB::unprepared();

These are all prepared statement to prevent SQL injection into database. However you might needed to run query without binding value. To run query, use unprepared() method.

Note: Avoid run unprepared() method on user input value, this can be risk for SQL injection.

This way, you can run SQL query into Laravel application.