laravel raw query generator
$query = User :: where ([ 'dept_id' => $request -> dept_id , 'role' => 'emp' ]); $sql = $query -> toSql (); $bindings = $query -> getBindings (); $sqlWithBindings = Str :: replaceArray ( '?' , $bindings , $sql ); dd ( $sqlWithBindings );