This commit is contained in:
2025-10-25 20:11:21 +02:00
commit fd37421245
700 changed files with 211892 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
### Getting one recode from a has many relation
addSelect(['value_name' => Model::whereColumn('a','table.b')->take(1)])
### Dynamic Relationships Using Subqueries
The relation column can be added using a addSelect
### Calculate Totals Using Conditional Aggregates
case exists
### Optimize Circular Relationships
Manual set relation to the model instead of loading it again
### Getting LIKE to use an Index
Dont use wildcards on both sides
### Use Unions to Run Queries Independently
Where in
derived table
find users by x
union
find users by y