Cmd/Ctrl + K

Query builder

The query builder provides a fluent interface for SQL operations.

Select

Build a select query from a table and retrieve its matching rows.

Fetch a single row:

Where clauses

Add constraints to limit which rows a query reads or modifies.

Nested groups are supported with a callback:

Joins and grouping

Combine related tables and aggregate rows when a query spans multiple records or sources.

Use leftJoin(), rightJoin(), and crossJoin() when needed.

Insert

Insert one or more rows using associative column data.

Update

Apply new values to every row matched by the query constraints.

Delete

Delete every row matched by the query constraints.

Aggregates

Calculate counts and scalar aggregates without loading full result rows.

Available helpers include count(), sum(), avg(), min(), max(), exists(), doesntExist(), value(), and pluck().

Pagination

Paginate a query when results should be returned in bounded pages.

simplePaginate() returns data and simple previous/next pagination metadata.

Debugging SQL

Inspect the generated SQL and bindings before executing a query.