There is a request builder:
DB::table(DB::raw('first_table ft')) ->join(DB::raw('second_table st'), 'st.id', '=', 'ft.second_id') ->get([ 'ft.id', 'IF(st.condition IS NULL,0,1) as is_cond', ]);
Which gives an SQL error:
SQLSTATE[HY000]: General error: 4104 General SQL Server error: Check messages from the SQL Server [4104]
Due to the fact that the received request is as follows:
SELECT [ft].[id], [IF(st].[condition] AS [NULL,0,1)] ...
How can I insert a similar condition in the builder?