Scope Methods
Last updated
Last updated
Scope and group your queries using these methods.
having()
limit()
offset()
Set the name of the table to query.
Include a table alias using an array.
Select which columns to return. Can be a single column or an array of columns.
Filter the query using an array of keys and values. For example WHERE id = 1
or WHERE id IN (1,2)
or Mysql functions like CURDATE() or DATE_SUB(). For example WHERE created = CURDATE()
or using operators in combination with the column key (separated by colon). For example: WHERE id >= 1
or WHERE email LIKE '%.com'
.
Supported operators =, !=, <, >, <=, >=, LIKE, NOT LIKE, IS, IS NOT
. The default operator is =
.
Sort the results by one or more columns including sort order ORDER BY created DESC
.
Group rows by columns.