You have to use your table name also.
table.field
If two tables in a join have an ID column there will be confusion unless you use table names.
ID is just example that would be true for any column.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
maintaining some code that has DB queries that mix DB::raw with dbQuery. When a field is selected as an alias in a DB::raw query and then combined with dbquery left joins in Laravel 7.25.0 - it may complain that it has encountered a duplicate value for one or more of the aliases.
It appears to work without error in Laravel 7.2.0
Please or to participate in this conversation.