Skip to content

[10.x] Allow Expression at more places in Query Builder - #50402

Merged
taylorotwell merged 1 commit into
laravel:10.xfrom
pascalbaljet:db-expression-as-first-param
Mar 7, 2024
Merged

taylorotwell merged 1 commit into
laravel:10.xfrom
pascalbaljet:db-expression-as-first-param

Conversation

@pascalbaljet

Copy link
Copy Markdown
Member

The code below causes PHPStan errors because the second argument is an Expression instance. The instance will eventually be transformed in Grammer::whereColumn(), so this should be allowed.

DB::table('users', 't1')->leftJoin('users AS t2', DB::raw('t1.uid + 1'), '=', 't2.uid');

I added the Expression class to more docblocks to solve this. This relates to #46160

@pascalbaljet pascalbaljet changed the title Allow Expression at more places in Query Builder [10.x] Allow Expression at more places in Query Builder Mar 7, 2024
@taylorotwell
taylorotwell merged commit 745b205 into laravel:10.x Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants