MySQL wrote SQL by hand, and Databases with PDO sent it through PDO. Laravel 2,157 's query builder lets you chain PHP method calls instead, and a grammar class compiles them into the connection's dialect: MySQL 524 here, and MariaDB 3,681 , PostgreSQL 1,289 , SQLite 4,756 or SQL Server 6 unchanged. Every value travels as a PDO binding. Eloquent (Eloquent Models) is built on this layer, so these methods work there too.

The examples query MySQL's shop database through a least-privilege account (Least-Privilege Accounts). Each PHP listing runs as printed in php artisan tinker --execute; application code adds use Illuminate\Support\Facades\DB;.