Eloquent, Query Builder and raw SQL in Laravel compared: what each returns and the best use for each
SQL

Laravel: Eloquent vs Query Builder vs Raw SQL (When to Use Each)

The same Laravel queries written with Eloquent, the Query Builder and raw SQL, the SQL each one sends to MySQL, how to fix N+1 queries, safe bindings, and a simple rule for choosing.