I have the following data in the controller:
$sheets = printerChange::select('folhas');
$sheetsNew = printerChange::select('folhasnew');
$sheetsCompare = (int)$sheetsNew;
if(!is_null($sheetsCompare > 0)){
$calcSheets->folhasnew = $request->folhas - $calcSheets->folhas;
}
else{
$calcSheets->folhasnew = $request->folhas;
}
When I run, the following error appears in my browser:
Object of class Illuminate \ Database \ Eloquent \ Builder could not be converted to int
I searched a lot on the internet and could not find anything that would help me, I saw several forms of conversion but none helped me to this point.
Is something wrong with my syntax?
PS: As a database I'm using PostgreSQL.