How to use multiple subqueries in Laravel's Eloquent?
I have a SQL query like this: SELECT year FROM ( SELECT my_custom_function_for_get_year(week_start::date) AS year FROM ( SELECT date_trunc('week', week_start) AS week_start FROM generate_series('2023-01-01'::date, '2023-12-31'::date, interval '1 week') gs(week_start) ) as select1, (SELECT id FROM mytable) as select2 ) as…