convert sql query to laravel
This query is generated from midnightcowboycoder.com. Don't forget to replace backtick with a single quote.

DB::select(`rt.id`,`rt.type`,`rt.total_no_of_rooms`)
        -&gt;addSelect(DB::raw(`SUM(r.no_of_rooms) as reserved rooms`))
        -&gt;selectSub(`rt.total_no_of_rooms`, `rooms available`)
        -&gt;selectSub(`-`, `rooms available`)
        -&gt;selectSub(`SUM`, `rooms available`)
        -&gt;from(`Roomtypes as rt`)
        -&gt;join(`Reservations as r`, function($join) {
            $join-&gt;on(`r.roomtype_id`, `=`, `rt.id`)
                -&gt;on(`2018-04-11`, `&gt;=`, `r.check_in`)
                -&gt;on(`2018-04-12`, `&lt;=`, `r.check_out`);
            })
        -&gt;groupBy(`rt.id`)
        -&gt;groupBy(`rt.type`)
        -&gt;groupBy(`rt.total_no_of_rooms`)
        -&gt;get();