How do I get the result of query
that will be executed in the database?
Example:
foreach ($prestadores as $prestador){
$achou = \DB::table('modulo_pr_espelho')
->where('prestador_id','=', $prestador->id)
->whereMonth('data_emissao',$mes)->get();
if (!isset($achou)) {
print "Prestador : " . $prestador->razao_social;
}
}
I need to know how Eloquent
is mounting this query
:
select modulo_pr_espelho.* where prestador_id = 1 where month(data_emissao) = 11
What method do I retrieve the select
pure that was set by Eloquent
?