Level 50
Tried this tool, and it surprisingly worked pretty well. https://sql-to-laravel-builder.herokuapp.com/
DB::table(DB::raw('(select * from a_table) a'))
->join(DB::raw('another_table at'),'at.id','=','a.id')
->get();
Probably, someone else can explain or provide better solution then this.